Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
665 views
in Technique[技术] by (71.8m points)

eclipse - "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 'SoftwareJavaSoftJava 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 FilesCommon FilesMicrosoft SharedWindows Live;C:Program File
s (x86)Common FilesMicrosoft SharedWindows Live;C:Windowssystem32;C:Window
s;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Progra
m Files (x86)ATI TechnologiesATI.ACECore-Static;C:Program Files (x86)Window
s LiveShared;C:Program Files (x86)Common FilesAcronisSnapAPI;C:AIRin;C:
Program Files (x86)
odejs;C:SDKAndroidools;C:SDKAndroidplatform-tools;
C:SDKANTapache-ant-1.9.2in;C:Program FilesJavajdk1.7.0_40in

%JAVA_HOME% = C:Program FilesJavajdk1.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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

  1. Added key HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment
  2. Added String Value CurrentVersion = 1.7
  3. Added key HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment1.7
  4. Added String Value JavaHome = C:Program FilesJavajre7

Running cmd java -version and Eclipse now works


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...