Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Java gives "Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg'"

Tags:

java

scala

After years of working OK, I'm suddenly getting this message when trying to start the JVM:

Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg' 

I tried uninstalling, and got a message saying a DLL was missing (unspecified) Tried re-installing, all to no avail.

At the same time, when trying to start Scala I get:

\Java\jdk1.6.0_25\bin\java.exe was unexpected at this time. 

Checked %JAVA_HOME% and %path% - both OK

Can anyone help?

like image 551
Highland Mark Avatar asked May 17 '11 20:05

Highland Mark


1 Answers

I checked my environment variables - JAVA_HOME & PATH and they all refer to C:\java. So this was bit frustrating. After sometime I found that the default installation also copied java.exe, javaw.exe and javaws.exe to C:\Windows\System32 (i.e. uninstall of JRE didn't go well). I just removed them and voila, I'm back on track. That annoying error is no longer popping.

This works for me

So, If exists, remove java.exe, javaw.exe and javaws.exe from System32

like image 122
Full-Stack Software Engineer Avatar answered Oct 24 '22 03:10

Full-Stack Software Engineer