C:\>java -version
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
The fix is fairly simple. Type the following command -
where java
The output might be something similar -
C:\>where java
C:\Windows\System32\java.exe
D:\java\jdk-11.0.3\bin\java.exe
Determine all the places where java.exe shouldn't exist. In my case, its the System32 folder. Navigate to the folder(s) and move the different java executable files out of the directory into a temp directory.
java.exe
javaw.exe
javaws.exe
Run "java -version" command again, and this time it should give the right version based on the environment variables on the machine.




No comments:
Post a Comment