Friday, July 18, 2014

Error: opening registry key 'software javasoft java runtime environment'

I encountered this error when I tried to open the Android Device Monitor in Android Studio and it takes me two hours to tackle with it and I think I'll write down my thoughts.

I will summarize several methods to solve this problem from easy to complex:

1. First, if your Error looks like this:
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

has value 'X.X', but 'X.X' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

Then you could do steps as blow:
  1. Open Commend  Prompt, type "regedit" to open the Registry (be careful doing this)
  2. Go to "HKEY_LOCAL_MACHINE" on the left-hand side registry explorer/tree menu
  3. Click "SOFTWARE" within the "HKEY_LOCAL_MACHINE" registries
  4. Click "JavaSoft" within the "SOFTWARE" registries
  5. Click "Java Runtime Environment" within the "JavaSoft" list of registries
  6. Highlight "CurrentVersion" (should see it in the main registry key explorer window on the right)
  7. Change version to "x.x" (which you need)
If after doing this, the error became this:
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'

Then it means that you didn't have the CurrentVersion x.x installed or installed properly. So you need to install the correctly version from this website:  http://www.oracle.com/technetwork/java/javase/index.html

Don't forget to change your JAVA_HOME and your PATH after you install  the new JDK

2.  Second Error type (even without the CurrentVersion):
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

The you need to do these steps:
  1. Open Commend  Prompt, type "java -version" to check if there is an error
  2. If you got the error as like above, then you need do to the Control Panel -> Uninstall a Program and then removed java.
  3. Then you need to Re-install Java, you can install java from the website: http://java.com/
  4. Re-install your JDK from this website: http://www.oracle.com/technetwork/java/javase/index.html, and you have better to install the latest version.
  5. At last, don't forget to change your JAVA_HOME and your PATH after you install  the new JDK
So if you still cannot solve the problem or you want to share your methods, please leave a message below.
At last, in case of some one don't know how to change the JAVA_HOME and PATH under windows (7/8), I will show you as below:
  1. Open Computer, and then click Computer (beside File on the lefttop).
  2. Click the System Properties.
  3. Click Advanced system settings on the left bar
  4. Under the Advanced tab, click Environment Variables...
    • Click New  to add a new variable name and value:, or click the existing variable, and then click Edit to change its name or value.
    variable name: JAVA_HOME Value: C:\Program Files\Java\jdk 1.7.0_65
    • System variables, find Path, then click edit:
    • add the codes in the end of Variable Value
    "C:\Program Files\Java\jdk1.7.0_65\bin"

No comments:

Post a Comment