Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Could not find Java SE Runtime Environment." after installing Java

I was trying to set up Eclipse for trying my hand at Android app dev. I downloaded Eclipse and tried to run it... discovered I needed Java JDK. Googled and found JDK 7u40 (jdk-7u40-windows-x64.exe) and installed it. The install seemed to have gone dandy but when I tried to run Eclipse I got an error as well as if I try java version in cmd.

Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

I went to regedit, HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft and Java Runtime Environment doesn't exist in there. Seems like this is more of a symptom than the root cause of my problems.

My PATH looks like

PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
s (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Window
s;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra
m Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Window
s Live\Shared;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\AIR\bin;C:
\Program Files (x86)\nodejs\;C:\SDK\Android\tools;C:\SDK\Android\platform-tools;
C:\SDK\ANT\apache-ant-1.9.2\bin;C:\Program Files\Java\jdk1.7.0_40\bin\

%JAVA_HOME% = C:\Program Files\Java\jdk1.7.0_40

I'm running Windows 7 Pro 64-bit

I did already read through Error when checking Java version: could not find java.dll and linked materials

like image 663
azBrian Avatar asked Oct 12 '13 00:10

azBrian


People also ask

Where is Java SE Runtime located?

By default, the installer places a copy of the runtime environment in the C:\Program Files\Java\j2re1. 4.2 directory. In addition, if no more recent version is already installed on the machine, the installer puts copies of the java and javaw application-launcher executables in the Microsoft Windows system directory.

Why is my Java Runtime Environment not working?

If you have wondered how to fix Java issues, reinstalling it can help you. To fix the Java Runtime Environment not found error, make sure to have the latest version of Java. Download the JRE version that corresponds with your system type so you won't deal with other types of Java issues.


1 Answers

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

like image 193
azBrian Avatar answered Sep 30 '22 10:09

azBrian