简体   繁体   中英

How to change open JDK to oracle JDK?

I have open jdk 1.7.0 and oracle jdk1.8.0. I already set JDK1.8.0's environment variables just follow https://askubuntu.com/questions/175514/how-to-set-java-home-for-java But when I download open JDK1.7.0 and it is used automatically.When I type:

sudo update-alternatives --config java

There was only one configuration : /usr/lib/jvm/java-7-openjdk-amd64/jr/bin/java and there was no need to configure it.

And I do like this Switch from open jdk to Sun jdk It worked, but when i reboot my PC and it was no good.

How can i do?

I got an answer:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_121/bin/java 1200

There are a new configuration choice in java link group when I type:

sudo update-alternatives --config java

And now i can choose JDK1.8.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM