# Trying to find where Java "JRE" is located on Ubuntu 7.10 machine?

**URL:** <https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571>\
**Category:** Deployment\
**Created:** [January 14, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571 "2008-01-14T17:51:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 14, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571/1 "2008-01-14T17:51:06Z")

</div>

I’ve spent the last year developing a large Ruby on Rails 2.0  
application with over a 100 tables and controllers and hope to be  
deploying it soon.  
Before I moved from my Windows XP computer to deployment, I wanted to  
run it in a local Linux environment to sort out:

1. Amazon S3 files
2. RMagick (went south when I upgraded to Rails 2.0)
3. ARMailer (mail spooling program)

I’ve installed Ubuntu 7.10 and feel running the scripts to install  
Ruby and Rails are reasonable straightforward. I plan to run an Nginx  
server with multiple Mongrel clusters using Capistrano.  
What’s killing me is installing a graphic development environment such  
as Radrails (which I love on Windows XP) or Netbeans.  
Understand that I’ve been through the routine of installing “sudo apt-  
get install sun-java6-jre” many times. Once, for some unknown reason  
my Netbeans 6.0 came up fine (as it found the JRE location on its  
own), but I was unsure how it happened and elected to re-install my  
Ubuntu and try again.  
Anyway, I’m able to install the Netbeans to the point where it asks  
for the location of the “JRE”. The one time that it worked, this value  
was automatically filled in when Netbeans started for the first time.  
When I run “java -version” I get the latest 1.6 installation but  
can’t find out where the “JRE” is located. I’ve looked MANY places.  
Anyway, I’m desperate to move this project along and am happy to hire  
someone to consult on this matter.  
I am grateful for your reply.  
Kathleen Kennedy  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 15, 2008, 4:19am UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571/2 "2008-01-15T04:19:48Z")

</div>

Hi,

I dont know if anyone answered you but I believe its found in

/usr/lib/jvm/java-6-sun/jre

Regards,  
Jose.

On Jan 14, 2008 11:05 AM, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’ve installed Ubuntu 7.10 and feel running the scripts to install  
> for the location of the “JRE”. The one time that it worked, this value

–

“Eppure si muove”

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 15, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571/3 "2008-01-15T22:34:37Z")

</div>

Jose,  
My question turned out to be a ‘trick question’ as I found out that I  
must install the JDK and NOT the JDR to work with Netbeans on Ubuntu  
7.10.  
I am always amazed how the community seems to leave these LOCKED DOORS  
with no explanation. If you’re tasked with such an endeavor, please  
feel free to contact me.  
Thank you,  
Kathleen

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 21, 2008, 2:17am UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571/4 "2008-01-21T02:17:50Z")

</div>

That’s the unsaid open source credo: “Open but you have to work for  
it”

On Jan 15, 3:33 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 21, 2008, 3:38pm UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571/5 "2008-01-21T15:38:07Z")

</div>

Next time try running ‘which java’.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 27, 2008, 12:06pm UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571/6 "2008-01-27T12:06:56Z")

</div>

On ubuntu ‘which java’ will return /usr/bin/java which is a symlink to  
/etc/alternatives/java on ubuntu

This mechanism allows multipe jre/jdks to be installed. You can list,  
and set what the version of java is being used with update-alternatives

update-alternatives --list java

The output should look like something like this depending on versions  
installed.

/usr/lib/jvm/java-1.5.0-sun/jre/bin/java  
/usr/lib/jvm/java-6-sun/jre/bin/java  
/usr/bin/gij-4.2  
/usr/lib/jvm/java-gcj/jre/bin/java  
/usr/bin/gij-4.1

You can then set which one to use as follows

sudo update-alternatives --set java  
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java

Afterwards java -version returns

java version “1.5.0\_13”  
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0\_13-b05)  
Java HotSpot™ Server VM (build 1.5.0\_13-b05, mixed mode)

I hope this helps.

Regards,  
John

removed\_email\_address@domain.invalid wrote:

> > > > > Anyway, I’m able to install the Netbeans to the point where it asks  
> > > > > –
> > > > 
> > > > “Eppure si muove”- Hide quoted text -
> > > > 
> > > > - Show quoted text -

[http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&ll=53.40462,-6.364946&spn=0.033004,0.11467&z=14&om=1&msid=116685921175017216102.0004394bd4ce4dfebdfc3](http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&ll=53.40462,-6.364946&spn=0.033004,0.11467&z=14&om=1&msid=116685921175017216102.0004394bd4ce4dfebdfc3)
