Switching from open jdk to Sun jdk

I have a jdk1.7.0 directory in / usr / lib / jvm along with other versions of open-jdk. I want my Ubuntu 12.04 to consider this jdk (jdk1.7.0) as the main jdk. I do not want to use open-jdks.

When I enter java -version or javac -version, both times it returns that it uses openjdk and its jre. How to change it to jdk1.7.0?

+6
source share
2 answers

Put something like the following to your ~/.bashrc

 export JAVA_HOME="/usr/lib/jvm/jdk1.7.0" export PATH="$JAVA_HOME/bin:$PATH" 

to download the changes, you can simply run the new bash by typing "bash":]

+4
source

Modify the PATH variable so that /usr/lib/jvm appears before the directory that contains the Open JDK. If you use bash, you can do this in the .bashrc in your home directory.

0
source

All Articles