我的 Java 版本是最新版本,但我的 JVM 仍然是 1.5?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18314748/
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
My Java version is the newest version but my JVM is still 1.5?
提问by 572
Recently I tried to use Eclipsebut when I open it,it told me my JVM verion is too old
最近我尝试使用Eclipse,但是当我打开它时,它告诉我我的 JVM 版本太旧了
Incompatible JVM
Version 1.5.0_05 of the JVM is not suitable for this product.<br>
Version: 1.6 or greater is required
What make me feel strange is that' my java verion is the newest verion .
让我感到奇怪的是'我的java版本是最新的版本。
Also I have tried to install the last version from Oracle... jre,jdk or whatever, the same error come every time I start Eclipse
我还尝试从 Oracle 安装最新版本... jre、jdk 或其他任何东西,每次启动 Eclipse 时都会出现相同的错误
Please don't tell me to edit the data in "eclipse.ini"
from turning 1.6 to 1.5
as I have ever tried it and get an error by saving a .class file.E
请不要告诉我"eclipse.ini"
从 1.6 到 1.5编辑数据,因为我曾经尝试过它并通过保存 .class 文件得到错误。E
回答by user2696194
What does this site say?
这个网站说什么?
http://www.java.com/en/download/uninstallapplet.jsp
http://www.java.com/en/download/uninstallapplet.jsp
You should probably look for version 1.7, not 1.6. (That's more current)
您可能应该寻找 1.7 版,而不是 1.6 版。(那是最新的)
If you have an older version of Java, go here:
如果您有旧版本的 Java,请转到此处:
回答by Aniket Thakur
In your ~/.bashrc file add the following lines
在您的 ~/.bashrc 文件中添加以下几行
export JAVA_HOME=/home/username/jdk1.7.0_11
export JDK_HOME=$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
in place of jdk1.7.0_11 put your JDK and see to it that the specified path is correct(wherever you have youe JDK).
代替 jdk1.7.0_11 放置您的 JDK 并确保指定的路径正确(无论您拥有 JDK 的位置)。
回答by LePeruvien
I doesn't know what did you do before, but you have to check :
我不知道你之前做了什么,但你必须检查:
The java version (according with your eclipse and its version). The JAVA_HOME path (jdk) in global environment variables. Try to change the runtimes environment in Eclipse.
java 版本(根据您的 eclipse 及其版本)。全局环境变量中的 JAVA_HOME 路径 (jdk)。尝试更改 Eclipse 中的运行时环境。
回答by abickerton
If this is happening when you click on the Eclipse icon, make sure that you have completely removed any previous Java installation. If you need to have Java 1.5, make sure that this installation is not referenced in the PATH environment variable.
如果在您单击 Eclipse 图标时发生这种情况,请确保您已完全删除任何以前的 Java 安装。如果您需要 Java 1.5,请确保 PATH 环境变量中未引用此安装。
If you can start eclipse, you can configure Eclipse projects to use the correct Java installation.
如果可以启动 eclipse,则可以配置 Eclipse 项目以使用正确的 Java 安装。
- Click Window->Prefences from the menu.
- Select Java-> Installed JREs
- Select Add
- Select Standard VM
- Set the directory to your 1.6 jdk directory.
- 从菜单中单击“窗口”->“首选项”。
- 选择 Java-> 已安装的 JRE
- 选择添加
- 选择标准虚拟机
- 将目录设置为您的 1.6 jdk 目录。
回答by Davi Sales
This happen when you have another java version installed in your S.O. and the path to this version stay in "Environment Variables"."Path". So, remove any path that is pointing to another old version of java. In my case, i have oracle Forms6i installed in my S.O., and the installation program putted the path to the java 1.4. In my case the path was: C:\oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client; C:\oracle\product\10.1.0\Client_1\jre\1.4.2\bin;
当您在 SO 中安装了另一个 Java 版本并且该版本的路径保留在“环境变量”.“路径”中时,就会发生这种情况。因此,删除指向另一个旧版本 java 的任何路径。就我而言,我在我的 SO 中安装了 oracle Forms6i,并且安装程序将路径放到了 java 1.4 中。在我的例子中,路径是:C:\oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client; C:\oracle\product\10.1.0\Client_1\jre\1.4.2\bin;
To access "Ambient Variables" no windows, right click mouse button on "My Computer" -> "Properties". On the left side click in "Advanced System Settings", on the top, click in the guide "Advanced", then click in the last button on the bottom, "Enviroment Variables". On the bottom have "System Variables", search for "Path" and do what i said there on top.
要在没有窗口的情况下访问“环境变量”,请右键单击“我的电脑”->“属性”上的鼠标按钮。在左侧单击“高级系统设置”,在顶部单击“高级”指南,然后单击底部最后一个按钮“环境变量”。在底部有“系统变量”,搜索“路径”并按照我在上面说的做。