Switch from open jdk to Sun jdk

雨燕双飞 提交于 2019-12-04 23:21:42

问题


I have jdk1.7.0 directory in /usr/lib/jvm along with other open-jdk versions. I want my Ubuntu 12.04 to treat this jdk(jdk1.7.0) as its primary jdk i.e. I dont want to use open-jdks.

When I type java -version or javac -version, both the times it returns that it is using openjdk and its jre. How can change it to jdk1.7.0?


回答1:


Put something similar to following to your ~/.bashrc

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

for loading the changes, you can just run new bash by typing "bash" :]




回答2:


Change the PATH variable so that /usr/lib/jvm is listed before the directory which contains Open JDK. If you are using bash, you can do this in the .bashrc file in your home directory.



来源:https://stackoverflow.com/questions/13851621/switch-from-open-jdk-to-sun-jdk

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!