“Could not find Java SE Runtime Environment.” after installing Java

放肆的年华 提交于 2019-11-28 09:15:20

Finally found a forum post that outlined what the registry is supposed to look like when not broken.

  1. Added key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
  2. Added String Value CurrentVersion = 1.7
  3. Added key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7
  4. Added String Value JavaHome = C:\Program Files\Java\jre7

Running cmd java -version and Eclipse now works

You can tell eclipse which JRE to use in the eclipse.ini. If you've installed bundles that require 1.7 in your IDE you will need a 1.7 JRE to run the IDE itself. add the below lines to eclipse.ini file

-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
.
.
.

You can try reinstall your JDK. I've had this problem because I uninstalled so many java things in my PC. And when I open Eclipse, the error occurred.

A 32 bit eclipse cannot load a 64 bit Java Runtime Environment.

Try again with a 32 bit Java Runtime Environment, or (preferred) upgrade your Eclipse to a 64 bit version.

Also, a good idea (from the command line)

C:> java -version

Which should give you details about your JVM. If it doesn't work, focus on fixing that before fixing Eclipse's use of Java.

As most of us suggested to edit the registry, but in case you don't want to, because it's risky or you don't have permissions to do so, you can uninstall all the java version, restart your machine, install desired java version, make sure to set path settings. This worked for me.

I was getting the same error (below) for Oracle when I clicked on a G2 application.

Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'

Error: could not find java.dll

Error: Could not find Java SE Runtime Environment.

I restarted the machine, still the same.

I reinstalled the app (which includes Oracle), still the same.

I checked all the suggested registry settings as suggested and my registry was fine.

I checked the shortcut path and it fires up javaw.exe with a string following within the shortcut. I navigated to the G2 program files and I tried clicking in the javaw.exe directly within the application folder and got the same error.

I did some research into this and found that Java has a Javaw.exe within the following path:

C:\Program Files\Java\jre7\bin\javaw.exe

I navigated to the path and clicked on this javaw.exe file and didn't get any errors

I renamed the javaw.exe in the G2 app to javaw_old.exe and then copied and pasted the javaw.exe file from the above path into my app folder. Files side by side, you could see a file size difference and the date was 8 months difference. The newer and larger file being the one in the latest Java install folder.

Clicked on the G2 shortcut and the application opened without any errors.

If you have the same issue as me where everything Java is okay and your still getting the error, try find the java(.exe) file that your app is erroring on, rename it and copy and paste the same file from your Java folder (C:\Program Files\Java\jre7\bin) to the same folder your app's Java file is located.

I hope this helps someone.

Just reinstall your JRE. You will probably need to restart a computer after uninstalling.

Having both 1.7 and 1.8 caused me this problem. While uninstalling 1.8 some of the 1.7 registry keys were removed I guess. I was missing the key Java Runtime Environment and JavaHome String. Uninstalling all the versions of JDK and reinstalling the 1.7(update 80) solved me the problem.

I had exactly the same problem and exactly same set of errors. That was because my registry key Java Runtime Environment was missing altogether. I did not have any conflicting 32/64 bit settings or any conflicting 1.7/1.8 settings.

All I did was install an update provided by Java and my settings went haywire. What I did to resolve was, instead of updating registry entries myself, I simply did an uninstall and fresh install of JRE and everything was back to normal.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!