Linux debian 新手并尝试将 Java 7 设为使用的默认 Java 版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10401776/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Newbie on debian and trying to make Java 7 the default java version used
提问by Melinda
2 questions.
2个问题。
- After installing the Oracle Java 7 on my new Debian local box, I opened up a terminal and executed the following command:
- 在我的新 Debian 本地机器上安装 Oracle Java 7 后,我打开一个终端并执行以下命令:
java -version
版本
When I did that it states: java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
当我这样做时,它指出: java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) Client VM(build 20.1-b02,混合模式,共享)
I installed the Java 7 JDK and Java 7 JRE in the following directories respectively:
我分别在以下目录中安装了 Java 7 JDK 和 Java 7 JRE:
/usr/lib/jvm/jdk1.7.0 /usr/lib/jvm/jre1.7.0
/usr/lib/jvm/jdk1.7.0 /usr/lib/jvm/jre1.7.0
- Is there a way to remove the java-6-sun and java-6-sun-1.6.0.26 folders as well or will it hurt just to leave them there?
- 有没有办法删除 java-6-sun 和 java-6-sun-1.6.0.26 文件夹,或者只是将它们留在那里会受到伤害吗?
Any help/direction on these 2 questions would be appreciated.
对这两个问题的任何帮助/指导将不胜感激。
Regards.
问候。
采纳答案by Mike McMahon
sudo update-alternatives --config java
须藤更新替代品--config java
Is the command to swap it i believe.
我相信是交换它的命令。
You can then call
然后你可以打电话
which java
哪个java
and it should reference the version selected.
它应该引用所选的版本。
回答by Bastien Durel
sudo update-java-alternatives -s ...
will configure all the alternatives at the same time
update-java-alternatives -l
lists the alternatives
sudo update-java-alternatives -s ...
将配置所有备选方案同时
update-java-alternatives -l
列出备选方案