PDA

View Full Version : trouble configuring javaee 5



vra5107
November 24th, 2009, 08:27 PM
Hello

I have been trying to install javaee 5. I downloaded the zip file and installed it in /opt. When which java is run, the following is the output.


vensoft@ven-10-c11:/opt/SDK$ which java
/usr/bin/java
vensoft@ven-10-c11:/opt/SDK$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 2009-11-05 12:55 /usr/bin/java -> /etc/alternatives/java
vensoft@ven-10-c11:/opt/SDK$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 36 2009-11-05 12:55 /etc/alternatives/java -> /usr/lib/jvm/java-6-sun/jre/bin/java


after reading a few blog posts I concluded I have to change the environment variables in the /etc/bash.bashrc file. The following are the changes I made.

export JAVA_HOME="/opt/SDK/jdk"
export CLASSPATH="/opt/SDK/jdk/lib"


When I check for the values of these variables everything seems fine.


vensoft@ven-10-c11:/opt/SDK$ echo $JAVA_HOME
/opt/SDK/jdk
vensoft@ven-10-c11:/opt/SDK$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games


but when run which java again the result is the same.

So I tried adding these variables s to the /etc/environment file. This one show weirdness of its own. When I save the file everything is saved, but when I try to echo the variables they are all blank.

I am relatively new to linux usage. Could some one help me .

Thanks
Venkat

baizon
November 24th, 2009, 08:29 PM
Try that: https://help.ubuntu.com/community/Java

vra5107
November 24th, 2009, 09:20 PM
Thanks for the reply. Thats another thing I forgot to mention. when
sudo update-java-alternatives -l I see only one alternative.


vensoft@ven-10-c11:/opt/SDK$ sudo update-java-alternatives -l
[sudo] password for vensoft:
java-6-sun 63 /usr/lib/jvm/java-6-sun


Is there a way I can add another alternative. I tried the --install command but with no result.

sudo update-alternatives --verbose --install /usr/bin/java java /opt/SDK/jdk/jre/bin/java 1

vensoft@ven-10-c11:/opt/SDK$ update-java-alternatives -l
java-6-sun 63 /usr/lib/jvm/java-6-sun


I still see only one option.

Thanks

baizon
November 24th, 2009, 11:10 PM
Have you tried that: http://ubuntuforums.org/showthread.php?t=366104 ?