[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I installed Sun's j2re1.4.2_04 and my update-alternative --install did not work



I had a similar problem. RadRails extension for Aptana and Aptana require using Sun's Java. So I was trying to install the latest jdk and use the jre that comes with it. The rpm installed fine but when I did update-alternatives --config java, the new java version did not display.
I finally figured out the syntax for adding to the list of available java alternitives using update-alternatives.
The syntax that I used was:
update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_06/jre/bin/java 18000
I got a clue from the /etc/alternitives dir and some stuff on the web.

you can get what you need for the first arg by using which java

the second is of course just java

and the third you can narrow it down using
locate -r "jre.*/java$" (assuming updatedb has been run since the java version you want was installed)
or
find /usr /opt ~ -path "*/jre/*" -name "java" (if the locate is not a good option, this will take a lot longer.)


the forth is just a priority number that is used when you don't explicitly set which java runtime to use. not sure who the auto method works.

after that you can do
update-alternatives --config java
and choose the one you want.

hope this helps someone.

:)

Reply to: