When running "java -version" on command prompt Windows 7, i get this:
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
I have already checked environment variables:
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_212\bin
And PATH
includes "%JAVA_HOME%
I have also tried deleting files :
java.exe, javaw.exe and javaws.exe in ProgramData\Oracle\JAVA\Javapath
However, they won't delete. Even though I am an administrator.
I have also checked C:\Windows\System32
and C:\Windows\SYSWOW64
and didnt find java.exe, javaw.exe or javaws.exe to delete.
What else can I try?
JAVA_HOME
should be the path excludingbin
and PATH should includebin
as%JAVA_HOME%/bin
4. Are there duplicate entries inPATH
and also duplication between user and system variables? 5. Can you directly go (cd) to JDK/JRE bin directory wherejava
executable is present and runjava -version
? – Extraterritorial%JAVA_HOME%\bin'. Use
regedit' command to open the registry and look for the key you mentioned in your question. Cleanup/correct it if you see discrepancy. – ExtraterritorialHKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\CurrentVersion
. – Extraterritorial