Java ubuntu 中不支持的 Major.minor 版本 52.0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28541629/
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
Unsupported major.minor version 52.0 in ubuntu
提问by Nits
I am using jdk1.8.0_25
, and when I check the version of Java with the following command:
我正在使用jdk1.8.0_25
, 当我使用以下命令检查 Java 版本时:
java -version
it outputs the following
它输出以下内容
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
Please solve my problem.
请解决我的问题。
回答by Brett Okken
Run the command />which java
to determine where the java
command is coming from on the path.
运行命令/>which java
以确定java
命令在路径上的来源。
You either need to change to put jdk 1.8 on the path or use the fully qualified path to the java
executable.
您需要更改以将 jdk 1.8 放在路径上,或者使用java
可执行文件的完全限定路径。
回答by Sebastian
Maybe you have more than one java JDK installed. Try to check that by
也许你安装了不止一个 java JDK。尝试通过
sudo update-alternatives --config javac
回答by mish
You can install several different java versions on to your system. You can set the default using the update-alternatives command.
您可以在系统上安装多个不同的 Java 版本。您可以使用 update-alternatives 命令设置默认值。
Here is a solution to a similiar problem, which is maybe of use for you: https://askubuntu.com/questions/121654/how-to-set-default-java-version
这是一个类似问题的解决方案,可能对您有用:https: //askubuntu.com/questions/121654/how-to-set-default-java-version
回答by snazzybucket
I got the same error, and while the java version correctly set to 8, my JAVA_HOME env var was still set to 7.
我遇到了同样的错误,虽然 java 版本正确设置为 8,但我的 JAVA_HOME env var 仍然设置为 7。
Executing this fixed it for me:
执行它为我修复了它:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle