Page 1 of 1

Need help getting Oracle Java to work

Posted: Fri Nov 23, 2012 11:22 pm
by ittech70
I have tried installing Oracle Java 7 update 9 (jdk and jre) in Nadia but neither one will work.

I have used the commands:

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_09/bin/javac" 1
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_09/bin/java" 1
sudo update-alternatives --set "javac" "/usr/lib/jvm/jdk1.7.0_09/bin/javac"
sudo update-alternatives --set "java" "/usr/lib/jvm/jre1.7.0_09/bin/java"

I have configured my PATH and JAVA_HOME by adding the following to my .bashrc:
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_09
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH

When I type java or java -version I get the error message: bash: /usr/bin/java: No such file or directory

If I navigate to /usr/lib/jvm/jdk1.7.0_09 and type ./java or ./javac I stil get that error message.

Typing echo $JAVA_HOME will show: /usr/lib/jvm/jdk1.7.0_09

I have run the command, sudo update-alternatives --config java, to try this method but this does not help either. When I do run that command I see the following:

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode
1 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
* 2 /usr/lib/jvm/jre1.7.0_09/bin/java 1 manual mode

I have had Oracle Java working in previous versios of Linux Mint and Ubunto but I cannot get it working in this one. Does anyone have any ideas that may help. I have even tried reinstalling Mint. Also, is it possilbe to completly remove openjdk? I have tried but when I remove openjdk6 openjdk7 will install, and when I try to remove openjdk7 openjdk6 get installed again.

Thanks for any help.

Re: Need help getting Oracle Java to work

Posted: Fri Nov 23, 2012 11:26 pm
by wayne128
Since you are using Ubuntu based Mint, the easier method to install oracle java is to use ppa.

this is the link
http://www.webupd8.org/2012/01/install- ... u-via.html

Re: Need help getting Oracle Java to work

Posted: Fri Nov 23, 2012 11:35 pm
by ittech70
Thanks for the link. I saw that before but was not sure if it was a trusted PPA.