为什么我仍然无法找到 Java SE 运行时环境?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27499607/
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
Why am I still getting a cannot find Java SE Runtime Environment?
提问by committedandroider
These are the errors I get when I try to run a simple java version in the command window.
这些是我尝试在命令窗口中运行简单的 Java 版本时遇到的错误。
I followed the advice on Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'?.
When I went on regedit, here's what I saw
我遵循了关于错误的建议:注册表项 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'?. 当我继续使用 regedit 时,这是我看到的
Which meant that there was nothing to change - right runtime version. I then did the next step which was to "delete all previous versions of Java (using "Programs and Features" uninstall process) and then re-install just the version you want to work with"
However, that didn't work either......
Here is my current java directory(see that i have everything installed)
这意味着没有什么可以改变 - 正确的运行时版本。然后我做了下一步,即“删除所有以前版本的 Java(使用“程序和功能”卸载过程),然后仅重新安装您想要使用的版本”但是,这也不起作用.. .... 这是我当前的 java 目录(看到我已经安装了所有东西)
And my current environmental variables are
我目前的环境变量是
JAVA_HOME - C:\Program Files\Java\jdk1.7.0_71
Path - C:\Program Files\Java\jdk1.7.0_71\bin
which i believe are correct as well from http://www.oracle.com/technetwork/java/javase/install-windows-189425.html
我认为来自http://www.oracle.com/technetwork/java/javase/install-windows-189425.html 的也是正确的
Does anyone know how i can get rid of this issue? I could do one more uninstall/install but I think that be a waste of time and won't make a difference.
有谁知道我如何摆脱这个问题?我可以再卸载/安装一次,但我认为这是浪费时间,不会有什么不同。
采纳答案by committedandroider
I want to thank @almas-shaikh for this answer. His comment made me check over C:\Program Files\Java\jdk1.7.0_71\jre\bin and see that there was no java.dll library file inside that directory. What I did next was just deleting the jdk and reinstalling it via jdk-7u71-windows-x64.exe executable.
Now when I execute java -home, I get
我要感谢@almas-shaikh 的回答。他的评论让我检查 C:\Program Files\Java\jdk1.7.0_71\jre\bin 并看到该目录中没有 java.dll 库文件。我接下来所做的只是删除 jdk 并通过 jdk-7u71-windows-x64.exe 可执行文件重新安装它。现在当我执行 java -home 时,我得到
Now the part I don't get is how the java.dll library file was deleted in the first place......
现在我没搞懂的部分是java.dll库文件是如何被删除的……
回答by aurelius
try adding "%JAVA_HOME%\bin;" in the Path section instead of this "C:\Program Files\Java\jdk1.7.0_71\bin", should make no difference but just try it like this.
尝试添加“%JAVA_HOME%\bin;” 在 Path 部分而不是这个“C:\Program Files\Java\jdk1.7.0_71\bin”,应该没有区别,只是像这样尝试。
回答by Ye Win
Please try the steps. I hope, it will help you.
请尝试以下步骤。我希望,它会帮助你。
Step 1:Delete all previous versions of Java (using "Programs and Features" uninstall process). If java folder is remain in "C:/Program Files/...", please delete it.
步骤 1:删除所有以前版本的 Java(使用“程序和功能”卸载过程)。如果java文件夹仍然在“C:/Program Files/...”中,请删除它。
Step 2:Clean up your registry(delete your java key). Please follow the below link for step by step clean up
https://java.com/en/download/help/manual_regedit.xml
第 2 步:清理您的注册表(删除您的 Java 密钥)。请按照以下链接逐步清理
https://java.com/en/download/help/manual_regedit.xml
Step 3:Reinstall Java and sets system variable JAVA_HOME to your JDK path.
Eg:
JAVA_HOME - C:\Program Files\Java\jdk1.7.0_71
Path - C:\Program Files\Java\jdk1.7.0_71\bin
第 3 步:重新安装 Java 并将系统变量 JAVA_HOME 设置为您的 JDK 路径。
例如:
JAVA_HOME - C:\Program Files\Java\jdk1.7.0_71
路径 - C:\Program Files\Java\jdk1.7.0_71\bin
Step 4If step 3 is success, check with below command
1) echo %JAVA_HOME%
2) java -version
步骤 4如果步骤 3 成功,请检查以下命令
1) echo %JAVA_HOME%
2) java -version
回答by user7896573
I had similar problem. Turns out, even when you have 64-bit OS, your browser is most likely 32-bit and therefore your JAVA too. You need to manually install 64-bit JAVA.
我有类似的问题。事实证明,即使您拥有 64 位操作系统,您的浏览器也很可能是 32 位的,因此您的 JAVA 也是如此。您需要手动安装 64 位 JAVA。
I hope that will help.
我希望这会有所帮助。
回答by srijib
java installation will create a folder similar to this C:\ProgramData\Oracle\Java. rename and again try cmd java -version.
java 安装将创建一个类似于 C:\ProgramData\Oracle\Java 的文件夹。重命名并再次尝试 cmd java -version。
make sure you have path variable set to latest jre/bin folder
确保您将路径变量设置为最新的 jre/bin 文件夹