Hello guys, if you are getting "Error: could not open 'C:\Java\jre8\lib\amd64\jvm.cfg'" error or just Error: could not open 'jvm.cfg and wondering what to do and how to solve this error then you have come to the right place. I will show you how I solved this error and how you can use my tips to solve your error as well. A couple of weeks back I updated my laptop to Windows 10 but after trying for one day, I reverted back to Windows 8.1. Everything was alright until I open Eclipse, which was throwing "Error: could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg', as soon as I launch it. It was quite bizarre because everything was fine earlier.
I suspect a Java installation problem, so I went to the command prompt and typed Java, only to find the same error there as well. You can see below, I am just trying to run the "java" command from the MS-DOS window. Here "java" command is picked from PATH environment variable.
$ java
Error: could not open `C:\Program Files\Java\jre8\lib\amd64\jvm.cfg'
Then I checked my environment variables, JAVA_HOME, and PATH and they all refer to C:\Program Files\Java. So this bit frustrating. After some time, 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, the error was gone. That annoying error is no longer popping.
Error: could not open 'C:\Java\jre7\lib\i386\jvm.cfg' - Solution
If you are facing the same problem i.e. getting the Error: could not open 'C:\Java\jre7\lib\i386\jvm.cfg', then check your System32 folder and remove java.exe, javaw.exe, and javaws.exe if they exist there.
Here are the exact steps to solve could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg' error:
1) Go to C:\Windows\System32
2) Search for Java in that folder
3) Remove java.exe, javaws.exe and javaw.exe from this folder
4) Open the command prompt
5) Type Java it should work
Mind you, your error could be little different than mine depending upon whether your laptop is 32-bit or 64-bit. For example, if you are using 32-bit JVM then you can get something like Error: could not open 'C:\Java\jre7\lib\i386\jvm.cfg'.
That's all about how to fix this error: could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg' in Windows 8 and Windows 10. I have got this with Eclipse, but you can also see this with any other Java application like IntelliJIDEA, NetBeans or Minecraft.
Related troubleshooting guides
Here are some handy Java tips to solve some common errors and exception in Java:
- How to fix Caused By: java.lang.NoClassDefFoundError: org/apache/log4j/Logger (solution)
- How to solve "could not create the Java virtual machine" error in Java? (solution)
- Fixing java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 (solution)
- How to avoid ConcurrentModificationException while looping over ArrayList in Java? (solution)
- How to deal with java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject? (solution)
- Difference between NoClassDefFoundError and ClassNotFoundException? (answer)
- How to fix 'javac' is not recognized as an internal or external command (solution)
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory error (solution)
- How to solve java.lang.OutOfMemoryError: Java Heap Space in Eclipse, Tomcat? (solution)
- How to solve java.lang.ClassNotFoundException: com.mysql.jdbc.Driver error? (hint)
- How to fix java.lang.OutOfMemoryError: Direct Buffer Memory? (solution)
- How to solve java.lang.classnotfoundexception oracle.jdbc.driver.oracledriver? (solution)
- java.lang.ClassNotFoundException : org.Springframework.Web.Context.ContextLoaderListener (solution)
- How to fix java.lang.OutOfMemoryError: Java Heap Space in Eclipse, Tomcat? (solution)
thanks!
ReplyDeleteWorked like a charm,Thanks Man
ReplyDelete@Khusbhu, Glad to know that this tip helped you :-)
DeleteDid not work for me, I'm on Windows 8 and my message says the same as yours.
ReplyDeletedid you find a fix? This solution did not fix my problem either.
DeleteThanks man .. It worked for me
ReplyDeleteWelcome Anonymous
DeleteI have same problem, i deleted these files from system32 and still doesn't work. I don't have any idea what should i do. Please help
ReplyDeleteHello @Anonymous, copy those file again from JAVA_HOME/bin director to the system32. The JAVA_HOME is the JDK installation directory, something like C:\Program Files\Java\jdk_xx
DeleteAnd if we can't be able to found the java.exe and others in the system32 folder
ReplyDelete@unknown, then you need to copy it from the JAVA_HOME or JDK's bin directory. You will always find the java.exe there.
DeleteI found that 3 files in jdk's bin folder.. but i am not getting where to paste it?
Delete...and when you dont have the Java folder in System32? Coz that's my case.
ReplyDeleteLooks like I installed a 32bit on a 64bit machine. Gonna try to download the other and try again.
Hello Baryl, you don't need Java folder in System32, instead you just check if you have java.exe, javaw.exe etc there or not. If not, then copy it from your 32-bit or 64-bit JDK you have downloaded.
DeleteNO OPEN JAVA
DeleteError: could not open `C:\Program Files\Java\jre1.6.0_03\lib\i386\jvm.cfg'
DeleteThanks. It Works
ReplyDeleteIn my system32 there were no java files, not even the java folder. I read the other comments and copied the 3 files into system32. Still, it doesn't work.
ReplyDeleteAre your machine 64-bit? is there any other System folder where you can see those files?
DeleteIn my system32 there were no java files, not even the java folder. I read the other comments and copied the 3 files into system32. Still, it doesn't work and my system is 64 bit.
ReplyDeleteDid your problem solved or you still facing the same issue? most likely it will be on some other folder, just search for those file using Windows Explorer search and you will find it.
DeleteI searched the folder in all possible places, and I put it in the windows explorer search engine, and that folder doesn't appear, my system is 64 bits and I don't know what to do
DeleteExactly same issue as Jerid for me. Still doesn't work
DeleteBro i am still facing the problem.I rum windows 10,64 bit.please help
ReplyDeleteYou are Amazing.
ReplyDeleteThanks working fine
ReplyDeletegreat to hear that.
Deletei havent noticed any such file in system32 as java.exe,javaws.exe
ReplyDeletedid your issued fixed ?
DeleteNot working window 7
ReplyDeleteHello Tech, what error are you getting?
Deletethere are no such files in system32 folder , mine is windows 10 and i installed 64-bit only plz help .
ReplyDeleteHi, what error you are getting? for Windows 10 and 64-bit, see if there is a folder called C:\Windows\System64 or something? If you can post error, I may be able to suggest you better?
DeleteHello everyone you can find those three java folders in program Files(86) \common Files\oracle\java\javapath
DeleteAfter removing those files, now I am getting below error.
Delete'java' is not recognized as an internal or external command,
operable program or batch file.
Check your PATH and add your JAVA_HOME/bin directory into PATH. JAVA_HOME is the directory where you installed Java.
Deletenot able to solve the problem.i didnt get any java files in system32 and i went through all the comments here but not even single comment is helping me.i have searched in all folders but i didnt get it.
ReplyDeleteHi, what error you are getting? for Windows 10 and 64-bit, see if there is a folder called C:\Windows\System64 or something? If you can post error, I may be able to suggest you better?
Deletethere are no such files in system32 folder ,
ReplyDeleteand i installed 64-bit only plz help
hmm, not sure, need to look into it, is there a similar folder like system64, may be check there.
DeletePlease help in my C: windows\system32 there is no java or any java exe file so how can I solve this error
ReplyDelete"C:\prgram Files\Java\jre1.8.0_211\lib\amd64\jvm.cfg"
Just copy java.exe and other exce files from JRE/bin or JDK/bin folder into System32
DeleteHi, I am facing this error
ReplyDeleteError: could not open `C:\Program Files\Java\jre1.8.0_131\lib\amd64\jvm.cfg'
I have copied all exe files (javap,javac.java,javaw,javadoc) from jdk to system 32 but the problem still exists. I am not able to find javaws.exe.
Hello Anonymous, what are you trying to do? are you tring to compile Java code, running a JAR file or something else? Can you also check if JDK is in PATH or not? `C:\Program Files\Java\jre1.8.0_131\lib\amd64\jvm.cfg' points to JRE not JDK, if not, try adding JDK bin directory to PATH.
DeleteHello Javin,
ReplyDeleteI removed all the 3 java.exe,javaaws.exe and javaaw.exe but when I am running the script it is prompting to choose a program and if I choose java it is automatically getting terminated.please help me.
Hello javin,
ReplyDeleteI removed java.exe,javaaw.exe and javaaws.exe but when I run the script it is prompting to choose a program and when I choose java ,the script is terminating automatically.please help me in this.
Hello @Unknown, can yo provide more details, did you deleted from both System32 and Systemd64 folder (not sure what they call in 64 bit ) but basically check where does the Java is getting picked up first?
Deletethank you man ;)
ReplyDeleteError:could not open 'D:\s\lib\amd64\jvm.cfg
ReplyDeleteAnd java folder create in System32
hello @Unknonw what did you have tried so far?
Deletein my case i wont found anything in system32 folder
ReplyDeleteAre you running on 64-bit machine or laptop? how about checking the System folder?
DeleteThe above one did not work for me but rather searching for javaws in complete folder worked for me , i search all occurrence of java using search tool, the file was present at C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_xyz
ReplyDeleteThx for sharing your solution.
Deletei also didnt had java folder in system32, i found the 3 files at C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_xyz and removed them. It solved the problem for me! Thanks.
DeleteWorks. Thank you very much :)
ReplyDeleteglad to know that it solved your problem
Deletethank you very much
ReplyDeleteworks! Thank you............
ReplyDelete