[java] Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'?

When I run: C:\Users\ashahria\Downloads>java -jar schemaSpy_5.0.0.jar

I get the error below. What is wrong? How can I fix it?

Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

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

This question is related to java exception environment runtimeexception

The answer is


you may follow these steps :

  • set JAVA_HOME to jdk[without bin folder]
  • set PATH as %JAVA_HOME%/bin;
  • put java.exe , javaw.exe & javaws.exe to C:\ProgramData\Oracle\Java\javapath [I was having problem here].
  • double click on the java.exe
  • Also check and edit the registry value for JAVA current version if required.

it worked for me :)


I had Java 1.8 but had to downgrade to Java 1.6 for some reason. When I uninstalled java 1.8 and ran the command "Java -Version" from the command prompt, I got the error -

Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

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

Uninstalling 1.6 and then reinstalling 1.6 fixed the issue for me :-)


I tried the steps mentioned by @bcmoney but for me the current version was already set to the latest version. In my it was Java8.

I had various versions of java installed (java6, java7 and java8). I got the same error but instead of 1.5 and 1.7 i got 1.7 and 1.8. I uninstalled java6 on my windows 8.1 machine. After which i tried java -version in command prompt and the error did not appear.

I am not sure whether this is the right answer but it worked for me so i thought it would help the community too.


One Good solution is to restart the PC, this will make the right entry in the Registry of the PC. Restarting solves my problem


I ran into this issue after updating the Java JDK, but had not yet restarted my command prompt. After restarting the command prompt, everything worked fine. Presumably, because the PATH variable need to be reset after the JDK update.


set PATH=c:\Program Files\Java\jdk1.6.0_45\bin;%PATH%

this will work if you are working on command prompt


Other times you might have installed Java 7 and 8 both or twice, and from Add/remove programs unistall one of them and it should work.


Adjust the sequence of your environment variable %path% to make sure jre 1.7 is the default one.


I had various JDK from 1.5 to 1.7 installed on my PC. I had a need to learn JDK1.8 so installed and my earlier versions of Eclipse (depended on earlier versions of JDK) and I got errors launching my Eclipse IDE, on the command line I tried to check the Java Version and got the error below,

C:\>java -version
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.8', but '1.6' is required.
Error: could not find java.dll
Error: could not find Java SE Runtime Environment.

Solution:- I removed

C:\ProgramData\Oracle\Java\javapath;
from the PATH variable and moved %JAVA%\bin to the start of the PATH variable, that solved the problem for me.


Just Reinstall JDK 1.7 it will work.


Go to 'c:/Windows/System32' and delete the java.exe, javaw.exe and javaws.exe there. See at Registry Key '...' has value '1.7', but '1.6' is required. Java 1.7 is Installed and the Registry is Pointing to it


Your java version is 1.5 (you have jdk 1.5). The jar requires java version 1.7 (you should have jdk 1.7). You should download and install the 1.7 jdk from this website:

http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html


I just uninstalled my Java8 update and tried again. It worked ok!


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to exception

Connection Java-MySql : Public Key Retrieval is not allowed How to print an exception in Python 3? ASP.NET Core Web API exception handling Catching FULL exception message How to get exception message in Python properly What does "Fatal error: Unexpectedly found nil while unwrapping an Optional value" mean? what does Error "Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)" mean? Argument Exception "Item with Same Key has already been added" The given key was not present in the dictionary. Which key? sql try/catch rollback/commit - preventing erroneous commit after rollback

Examples related to environment

Using Pip to install packages to Anaconda Environment How to generate .env file for laravel? Set windows environment variables with a batch file Setting up Eclipse with JRE Path Changing default shell in Linux How to find the path of the local git repository when I am possibly in a subdirectory Windows 7 environment variable not working in path Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'? Java system properties and environment variables Environment variables in Eclipse

Examples related to runtimeexception

Error:Execution failed for task ':app:transformClassesWithDexForDebug' in android studio SEVERE: Unable to create initial connections of pool - tomcat 7 with context.xml file Why doesn't catching Exception catch RuntimeException? ActionBarCompat: java.lang.IllegalStateException: You need to use a Theme.AppCompat NameError: global name 'xrange' is not defined in Python 3 Unable instantiate android.gms.maps.MapFragment Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'? Android 'Unable to add window -- token null is not for an application' exception Understanding checked vs unchecked exceptions in Java Can't create handler inside thread which has not called Looper.prepare()