I installed several jdk version into my ubuntu system.
I modified the '.bashrc' or the '.bash_profile' files and set the JAVA_HOME properties ,but it didn't work.
In ubuntu , set the right like this (Debian command).:
winter@dodo:~$ sudo update-alternatives --config java
There are 3 alternatives which provide `java'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
* 3 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
Press enter to keep the default[*], or type selection number: 3
Using `/usr/lib/jvm/java-1.5.0-sun/jre/bin/java' to provide `java'.
I modified the '.bashrc' or the '.bash_profile' files and set the JAVA_HOME properties ,but it didn't work.
In ubuntu , set the right like this (Debian command).:
winter@dodo:~$ sudo update-alternatives --config java
There are 3 alternatives which provide `java'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
* 3 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
Press enter to keep the default[*], or type selection number: 3
Using `/usr/lib/jvm/java-1.5.0-sun/jre/bin/java' to provide `java'.
本文介绍了如何在Ubuntu系统中配置正确的Java版本。通过修改.bashrc或.bash_profile文件设置JAVA_HOME环境变量的方法并未生效。最终采用的是使用update-alternatives命令来选择所需的Java版本。
5352

被折叠的 条评论
为什么被折叠?



