Can anyone please tell me why I get the following error when I try to run my Java programs? The programs get compiled successfully but are not able to be run. I have already set the path of Java.
C:JavaServ>javac hello1.java
C:JavaServ>java hello1
Error: could not open C:Program FilesJavajre6libamd64jvm.cfg
asked Jan 29, 2012 at 5:10
1
Don’t think if this is a correct way…(perhaps proper installation of Java is a permanent solution)….but this is a trick..:)
Delete the “java.exe” file from “c:windows” and “c:windowssystem32″. That should fix it.
answered Jan 29, 2013 at 6:18
7
In case you get here and scroll this far down, the newer Oracle versions of Java x86 and probably also x64 are horribly broken. You may find that after removing all versions of Java, and even manually deleting all the versions you find in c:/program files/ and c:/program files (x86)/ that you still can’t properly run a fresh install of Java.
I’m here to tell you why, and how to fix it.
Go to C:Program FilesCommon Files and DELETE the Oracle directory. It has a version of Java underneath it inside a junction (symlink) that is sequestered away from all your other installs. Bastards.
Now, also go to System Properties -> Advanced -> Environment Variables and edit the PATH under System Variables. Find the place where the Oracle folder is referenced, and delete it. Close all your windows down, reboot to be extra sure if you want.
Install the JRE or JDK. Open a command prompt and type ‘java’ and if it comes up, you’re golden. If not, go back to the PATH variable and add «C:Program Files (x86)Javajdk1.8.0_221bin» or whatever looks right for your machine.
I hate Oracle.
answered Aug 22, 2019 at 21:42
Jason HughesJason Hughes
2,2151 gold badge10 silver badges8 bronze badges
2
this should be an internal file of JRE and in general you shouldn’t deal with it when you’re running/compiling java.
Here you can find an explanation of what exactly this file is intended for.
Bottom line, your Java installation is somehow corrupted, so as a first resort to resolve this issue, I suggest you to re-install jre.
You should ensure that you’re installing the right jre for your architecture.
Hope, this helps
answered Jan 29, 2012 at 5:47
Mark BramnikMark Bramnik
38.3k4 gold badges52 silver badges91 bronze badges
2
You can not Uninstall/Reinstall JRE if you are having this error.
That’s why because previous installation has copied 3 files namely Java.exe, Javaw.exe, javaws.exe in the c:/windows/system32 folder.
Simply go there and remove these files and download a fresh version of jre from oracle and install it. I will prefer JDK 1.6 update 45. Which is very stable.
answered Feb 3, 2014 at 9:45
Vaibhav JainVaibhav Jain
1,64123 silver badges32 bronze badges
0
Java mysteriously broke on my work PC after a security patch was pushed out to us, giving this error whenever you tried to run a Java program. Somehow the ‘lib’ subdirectory of the Java 7 install had vanished! It might have been related to having multiple Java versions installed simultaneously.
If you’re getting this error there are basically two things that could be wrong:
1) Your Java installation is broken. If the file/directory it’s complaining about doesn’t exist, uninstall and reinstall the JRE and then it should be there. This fixed it for me.
2) If the files are there, your PATH is somehow incorrect or pointing at an old/broken Java install. In this case you either need to fix your PATH to point to the correct java.exe/javaw.exe, or use a fully qualified path. So instead of:
java <whatever>
Use
c:<full path to correct JRE>binjava.exe <whatever>
3) If your PATH is correct and files are there and it’s still failing, the path could be getting truncated because it is too long. see: Running Java gives «Error: could not open `C:Program FilesJavajre6libamd64jvm.cfg'» .
answered Sep 24, 2013 at 18:03
1
i also had the same issue due to one more instance of java,javaw
and javaws
in C:WindowsSystem32
which was pointing to jre6
and my default location of jre was pointing to this(C:WindowsSystem32) location. Even having jdk 1.8 as my JAVA_HOME
location i were getting this problem.
so either remove or rename java,javaw and javaws it will work.
answered Feb 8, 2017 at 7:49
Piyush MittalPiyush Mittal
1,8301 gold badge19 silver badges39 bronze badges
0
If you have installer deployed Java on Windows and decided to bring some order to your JDKs with folders moving…
All answers with java.exe
in WindowsSystem32
are right but in more tough situation — there are no files, but error messages still happen, then remember about Windows Registry entries (look regedit.exe
).
They store information about JRE folder in this registry key:
win32:
HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment
win64:
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeJavaSoftJava Runtime Environment
answered May 24, 2019 at 12:19
rookrook
5,7104 gold badges38 silver badges51 bronze badges
The program can be compiled but while running it leads to such an error:
Could not open C:Program FilesJavajre6libamd64jvm.cfg
It indicates that the jvm.cfg file is missing in Program files. Reasons may be file corruption or file may be deleted. Install JRE again in «Program Files» folder.
Another case which happened with me is that I installed 32 bit jdk & jre in my 64 bit system in Program Files(x86) and my Program Files folder was empty. That was the reason for that error. So I installed 64 bit JRE in Program Files folder and it started to work. Note that it is not related to jdk version. Associated with only JRE problem.
j0k
22.4k28 gold badges80 silver badges89 bronze badges
answered Sep 24, 2012 at 17:19
0
I was getting the same error with my docear program on windows 7.
What I found is that I had two instances of java 1.6 installed on my computer. One instance has a jvm.cfg and the other does not.
Modifying my path to search the correct instance of java (in bold) first fixed the problem.
Here is my corrected path:
C:Userskranjit>path
PATH=C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32
WindowsPowerShellv1.0;C:Program Files (x86)Enterprise VaultEVClient;C:Program FilesJavajre6bin;C:Program Files (x86)Javajre6bin;
j0k
22.4k28 gold badges80 silver badges89 bronze badges
answered Dec 30, 2012 at 13:55
In our system, for «java(jre)» for runtime purpose is availed, So If you install any different version of java, propbably the version before the one which is already installed.
E.g.; my windows 8.1 I have runtime java version of 8, then when I install Ver7 it is bu default taking V8, yet I uninstall 8, In this kind of Scenarios, Removing java.exe from c:windowssystem32 makes my java runtime work
answered Jan 4, 2014 at 16:00
For anyone still having an issue I made mine work by doing this probably not the best fix but it worked for me..
I uninstalled all Java’s that i current had installed, reinstalled the latest one and changed the install directory to C:/Windows/jre (Basically where it kept saying there was no config file)
answered Aug 16, 2017 at 2:57
I want to add some pointers here.
Whenever you face the error saying Could not open jvm.cfg
, it means that there was some mess happened with java installation path
. Below approaches might help.
-
If java is added in environment path, then open command prompt and type
where java
. If you get list of directories where java path specified. Other than the directory where you need the java file, delete the java files in all other directories. -
If you are reading 2nd pointer, then 1st pointer might have not helped. Type
regedit
in run dialog and underHKEY_LOCAL_MACHINE
, go tosoftwares/javasoft
and rename the paths of the java installed directory.
Let me know if above approaches solve the problem.
Agilanbu
2,7312 gold badges28 silver badges33 bronze badges
answered Dec 14, 2018 at 10:33
-
The simple Solution is just
uninstall
thejavaSE
andreinstall
it to the default location. -
Then copy the installed location probably like
C:Program FilesJavajdk1.8.0_131bin
. -
After then go to desktop then while selecting right click on
My Pc or This pc shortcut
the under that selectproperties >> Advanced system settings >> under Advance tab >> last option Environment Variables..>>path >> edit >> past >> ;
(not required if win10)/(required if windows 7)
Agilanbu
2,7312 gold badges28 silver badges33 bronze badges
answered Jun 14, 2017 at 5:47
I had this issue when installing 201, somehow it didn’t uninstall my 191 properly. I had to go to the Program Files/Java folder, rename the old 201 directory, then install a fresh copy of 201. When doing so, it prompted me to uninstall 191, which I did. Now it’s working fine.
answered Feb 26, 2019 at 22:01
ShygarShygar
1,1438 silver badges10 bronze badges
I was facing the same issue after upgrading my java version.I had more than one jdk installation. I have manually uninstalled the old jdk version . Then it worked for me.
answered Mar 26, 2019 at 14:34
Resolved
I had similar issue, I tried different things but nothing worked. Then when I checked the installed programs. I could see two versions of java installed.
What I did is, just uninstall all java versions and freshly installed the required version. But this didn’t seem to work when I checked in terminal. Then I had to reopen the terminal and run the command, then only it worked.
Note : Dont forget to reopen the terminal if you are testing via terminal.
answered Aug 21, 2020 at 8:21
jithin johnjithin john
5424 silver badges12 bronze badges
I had an identical error trying to start IntellJ with a custom JBR.
C:Usersuser>"C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2021.3.3binidea.bat"
Error: could not open `C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2021.3.3jbr-arm64libjvm.cfg'
This issue may occur if there were problems extracting Java or OpenJDK from a zip or tarball (e.g. a slow extraction was terminated prematurely) or if the zip or tarball was corrupted or incomplete.
-
If caused by a corrupted zip or tarball, try redownloading the archive.
-
If caused by a bad extraction, repeating the extraction will fix this.
answered Sep 2, 2022 at 2:55
tresftresf
6,5545 gold badges38 silver badges97 bronze badges
Copying and pasting i386jvm.cfg
from a different PC will resolve the issue.
Adam Michalik
9,56512 gold badges67 silver badges102 bronze badges
answered Dec 2, 2015 at 14:55
2
I had the same issue.I just uninstalled Java and reinstalled again it worked fine after that . The problem is related to JRE so you can just reinstall JRE.
answered Jul 22, 2017 at 5:37
0
I had same problem — when I tried to run a Java program from command line the error message appeared: «Error: could not open jvm.cfg».
My Path environment variable included following path:
C:ProgramDataOracleJavajavapath
In the folder there were 3 exe files:
java.exe
javaw.exe
javaws.exe
When I removed the the entry
C:ProgramDataOracleJavajavapath
from the Path environment variable and restarted cmd, I could run the program as usual (java MyProg).
Obviously I have corrupted the path pointing to correct java jre installation
C:Program FilesJavajre1.8.0_151
somehow previously when I played with my settings.
answered Jan 6, 2018 at 21:39
0
It means that this jvm.cfg
file is not found. Maybe it was deleted. Reinstall
the program. If you have this problem with a game for example, reinstall Java
in the games folder, or copy Java files .de c:/Program Files/JAVA
and paste to the JAVA
folder in the game folder
Agilanbu
2,7312 gold badges28 silver badges33 bronze badges
answered Jan 31, 2016 at 19:20
Can anyone please tell me why I get the following error when I try to run my Java programs? The programs get compiled successfully but are not able to be run. I have already set the path of Java.
C:JavaServ>javac hello1.java
C:JavaServ>java hello1
Error: could not open C:Program FilesJavajre6libamd64jvm.cfg
asked Jan 29, 2012 at 5:10
1
Don’t think if this is a correct way…(perhaps proper installation of Java is a permanent solution)….but this is a trick..:)
Delete the “java.exe” file from “c:windows” and “c:windowssystem32″. That should fix it.
answered Jan 29, 2013 at 6:18
7
In case you get here and scroll this far down, the newer Oracle versions of Java x86 and probably also x64 are horribly broken. You may find that after removing all versions of Java, and even manually deleting all the versions you find in c:/program files/ and c:/program files (x86)/ that you still can’t properly run a fresh install of Java.
I’m here to tell you why, and how to fix it.
Go to C:Program FilesCommon Files and DELETE the Oracle directory. It has a version of Java underneath it inside a junction (symlink) that is sequestered away from all your other installs. Bastards.
Now, also go to System Properties -> Advanced -> Environment Variables and edit the PATH under System Variables. Find the place where the Oracle folder is referenced, and delete it. Close all your windows down, reboot to be extra sure if you want.
Install the JRE or JDK. Open a command prompt and type ‘java’ and if it comes up, you’re golden. If not, go back to the PATH variable and add «C:Program Files (x86)Javajdk1.8.0_221bin» or whatever looks right for your machine.
I hate Oracle.
answered Aug 22, 2019 at 21:42
Jason HughesJason Hughes
2,2151 gold badge10 silver badges8 bronze badges
2
this should be an internal file of JRE and in general you shouldn’t deal with it when you’re running/compiling java.
Here you can find an explanation of what exactly this file is intended for.
Bottom line, your Java installation is somehow corrupted, so as a first resort to resolve this issue, I suggest you to re-install jre.
You should ensure that you’re installing the right jre for your architecture.
Hope, this helps
answered Jan 29, 2012 at 5:47
Mark BramnikMark Bramnik
38.3k4 gold badges52 silver badges91 bronze badges
2
You can not Uninstall/Reinstall JRE if you are having this error.
That’s why because previous installation has copied 3 files namely Java.exe, Javaw.exe, javaws.exe in the c:/windows/system32 folder.
Simply go there and remove these files and download a fresh version of jre from oracle and install it. I will prefer JDK 1.6 update 45. Which is very stable.
answered Feb 3, 2014 at 9:45
Vaibhav JainVaibhav Jain
1,64123 silver badges32 bronze badges
0
Java mysteriously broke on my work PC after a security patch was pushed out to us, giving this error whenever you tried to run a Java program. Somehow the ‘lib’ subdirectory of the Java 7 install had vanished! It might have been related to having multiple Java versions installed simultaneously.
If you’re getting this error there are basically two things that could be wrong:
1) Your Java installation is broken. If the file/directory it’s complaining about doesn’t exist, uninstall and reinstall the JRE and then it should be there. This fixed it for me.
2) If the files are there, your PATH is somehow incorrect or pointing at an old/broken Java install. In this case you either need to fix your PATH to point to the correct java.exe/javaw.exe, or use a fully qualified path. So instead of:
java <whatever>
Use
c:<full path to correct JRE>binjava.exe <whatever>
3) If your PATH is correct and files are there and it’s still failing, the path could be getting truncated because it is too long. see: Running Java gives «Error: could not open `C:Program FilesJavajre6libamd64jvm.cfg'» .
answered Sep 24, 2013 at 18:03
1
i also had the same issue due to one more instance of java,javaw
and javaws
in C:WindowsSystem32
which was pointing to jre6
and my default location of jre was pointing to this(C:WindowsSystem32) location. Even having jdk 1.8 as my JAVA_HOME
location i were getting this problem.
so either remove or rename java,javaw and javaws it will work.
answered Feb 8, 2017 at 7:49
Piyush MittalPiyush Mittal
1,8301 gold badge19 silver badges39 bronze badges
0
If you have installer deployed Java on Windows and decided to bring some order to your JDKs with folders moving…
All answers with java.exe
in WindowsSystem32
are right but in more tough situation — there are no files, but error messages still happen, then remember about Windows Registry entries (look regedit.exe
).
They store information about JRE folder in this registry key:
win32:
HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment
win64:
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeJavaSoftJava Runtime Environment
answered May 24, 2019 at 12:19
rookrook
5,7104 gold badges38 silver badges51 bronze badges
The program can be compiled but while running it leads to such an error:
Could not open C:Program FilesJavajre6libamd64jvm.cfg
It indicates that the jvm.cfg file is missing in Program files. Reasons may be file corruption or file may be deleted. Install JRE again in «Program Files» folder.
Another case which happened with me is that I installed 32 bit jdk & jre in my 64 bit system in Program Files(x86) and my Program Files folder was empty. That was the reason for that error. So I installed 64 bit JRE in Program Files folder and it started to work. Note that it is not related to jdk version. Associated with only JRE problem.
j0k
22.4k28 gold badges80 silver badges89 bronze badges
answered Sep 24, 2012 at 17:19
0
I was getting the same error with my docear program on windows 7.
What I found is that I had two instances of java 1.6 installed on my computer. One instance has a jvm.cfg and the other does not.
Modifying my path to search the correct instance of java (in bold) first fixed the problem.
Here is my corrected path:
C:Userskranjit>path
PATH=C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32
WindowsPowerShellv1.0;C:Program Files (x86)Enterprise VaultEVClient;C:Program FilesJavajre6bin;C:Program Files (x86)Javajre6bin;
j0k
22.4k28 gold badges80 silver badges89 bronze badges
answered Dec 30, 2012 at 13:55
In our system, for «java(jre)» for runtime purpose is availed, So If you install any different version of java, propbably the version before the one which is already installed.
E.g.; my windows 8.1 I have runtime java version of 8, then when I install Ver7 it is bu default taking V8, yet I uninstall 8, In this kind of Scenarios, Removing java.exe from c:windowssystem32 makes my java runtime work
answered Jan 4, 2014 at 16:00
For anyone still having an issue I made mine work by doing this probably not the best fix but it worked for me..
I uninstalled all Java’s that i current had installed, reinstalled the latest one and changed the install directory to C:/Windows/jre (Basically where it kept saying there was no config file)
answered Aug 16, 2017 at 2:57
I want to add some pointers here.
Whenever you face the error saying Could not open jvm.cfg
, it means that there was some mess happened with java installation path
. Below approaches might help.
-
If java is added in environment path, then open command prompt and type
where java
. If you get list of directories where java path specified. Other than the directory where you need the java file, delete the java files in all other directories. -
If you are reading 2nd pointer, then 1st pointer might have not helped. Type
regedit
in run dialog and underHKEY_LOCAL_MACHINE
, go tosoftwares/javasoft
and rename the paths of the java installed directory.
Let me know if above approaches solve the problem.
Agilanbu
2,7312 gold badges28 silver badges33 bronze badges
answered Dec 14, 2018 at 10:33
-
The simple Solution is just
uninstall
thejavaSE
andreinstall
it to the default location. -
Then copy the installed location probably like
C:Program FilesJavajdk1.8.0_131bin
. -
After then go to desktop then while selecting right click on
My Pc or This pc shortcut
the under that selectproperties >> Advanced system settings >> under Advance tab >> last option Environment Variables..>>path >> edit >> past >> ;
(not required if win10)/(required if windows 7)
Agilanbu
2,7312 gold badges28 silver badges33 bronze badges
answered Jun 14, 2017 at 5:47
I had this issue when installing 201, somehow it didn’t uninstall my 191 properly. I had to go to the Program Files/Java folder, rename the old 201 directory, then install a fresh copy of 201. When doing so, it prompted me to uninstall 191, which I did. Now it’s working fine.
answered Feb 26, 2019 at 22:01
ShygarShygar
1,1438 silver badges10 bronze badges
I was facing the same issue after upgrading my java version.I had more than one jdk installation. I have manually uninstalled the old jdk version . Then it worked for me.
answered Mar 26, 2019 at 14:34
Resolved
I had similar issue, I tried different things but nothing worked. Then when I checked the installed programs. I could see two versions of java installed.
What I did is, just uninstall all java versions and freshly installed the required version. But this didn’t seem to work when I checked in terminal. Then I had to reopen the terminal and run the command, then only it worked.
Note : Dont forget to reopen the terminal if you are testing via terminal.
answered Aug 21, 2020 at 8:21
jithin johnjithin john
5424 silver badges12 bronze badges
I had an identical error trying to start IntellJ with a custom JBR.
C:Usersuser>"C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2021.3.3binidea.bat"
Error: could not open `C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2021.3.3jbr-arm64libjvm.cfg'
This issue may occur if there were problems extracting Java or OpenJDK from a zip or tarball (e.g. a slow extraction was terminated prematurely) or if the zip or tarball was corrupted or incomplete.
-
If caused by a corrupted zip or tarball, try redownloading the archive.
-
If caused by a bad extraction, repeating the extraction will fix this.
answered Sep 2, 2022 at 2:55
tresftresf
6,5545 gold badges38 silver badges97 bronze badges
Copying and pasting i386jvm.cfg
from a different PC will resolve the issue.
Adam Michalik
9,56512 gold badges67 silver badges102 bronze badges
answered Dec 2, 2015 at 14:55
2
I had the same issue.I just uninstalled Java and reinstalled again it worked fine after that . The problem is related to JRE so you can just reinstall JRE.
answered Jul 22, 2017 at 5:37
0
I had same problem — when I tried to run a Java program from command line the error message appeared: «Error: could not open jvm.cfg».
My Path environment variable included following path:
C:ProgramDataOracleJavajavapath
In the folder there were 3 exe files:
java.exe
javaw.exe
javaws.exe
When I removed the the entry
C:ProgramDataOracleJavajavapath
from the Path environment variable and restarted cmd, I could run the program as usual (java MyProg).
Obviously I have corrupted the path pointing to correct java jre installation
C:Program FilesJavajre1.8.0_151
somehow previously when I played with my settings.
answered Jan 6, 2018 at 21:39
0
It means that this jvm.cfg
file is not found. Maybe it was deleted. Reinstall
the program. If you have this problem with a game for example, reinstall Java
in the games folder, or copy Java files .de c:/Program Files/JAVA
and paste to the JAVA
folder in the game folder
Agilanbu
2,7312 gold badges28 silver badges33 bronze badges
answered Jan 31, 2016 at 19:20
Содержание
- Fix Could Not Open jvm.cfg in Java
- the Could Not Open jvm.cfg Error in Java
- Fix the Could Not Open jvm.cfg Error in Java
- Solution 1: Remove .exe Files From the System32 Folder
- Solution 2: Make Sure the Java PATH Is Correct
- Solution 3: Delete Oracle Directory Executable Files
- Solution 4: Uninstall Java and Reinstall It
- Путь Java .. Ошибка jvm.cfg
- 17 ответов
- Java Hungry
- [Solved] Error Could Not Open jvm.cfg
- Fixed- Error: could not open C:Program FilesJavajre8libamd64jvm.cfg
- Запуск Java дает «Ошибка: не удалось открыть C: Program Files Java jre6 lib amd64 jvm.cfg» »
- 21 ответы
Fix Could Not Open jvm.cfg in Java
Sometimes, we think everything is working as expected, but some issues are behind the scenes. Today, we will discuss a similar situation and determine possible solutions.
the Could Not Open jvm.cfg Error in Java
This error occurred when we updated our machine to Windows 10 but later reverted to Windows 8 for a few reasons. All the applications worked fine, but we had an issue running Java Programs.
Whenever we try to compile the Java program, it compiles successfully, but as soon as we run this, it gives an error as follows.
Example Code (We are using JDK 8 ):
Fix the Could Not Open jvm.cfg Error in Java
There are a few possible solutions for this. Let’s have a look at each of them below.
Solution 1: Remove .exe Files From the System32 Folder
Go to the folder System32 , which resides in the C:Windows location.
Remove the java.exe , javaws.exe , and javaw.exe from the folder. The error is gone; now, run the program again to get your desired results.
If this solution does not work for you even after deleting the .exe files, then go for the following solution.
Solution 2: Make Sure the Java PATH Is Correct
The other reason can be having an incorrect Java Path. So, write the following line at the start of the PATH .
The error must be resolved. If the error persists, then we can try the following solution.
Solution 3: Delete Oracle Directory Executable Files
Go to the following directory.
Start looking for the executable files related to Java. Remove them if you find them.
Now, the error is resolved. If you are still reading this article, the error still annoys you.
So, go for the final solution, which is given below.
Solution 4: Uninstall Java and Reinstall It
The final solution is to uninstall Java. Make sure that you remove the references to it from the Registry and then reinstall it.
This trick must work, and you must eliminate the error now.
Mehvish Ashiq is a former Java Programmer and a Data Science enthusiast who leverages her expertise to help others to learn and grow by creating interesting, useful, and reader-friendly content in Computer Programming, Data Science, and Technology.
Источник
Путь Java .. Ошибка jvm.cfg
Может кто-нибудь скажет мне, почему я получаю следующую ошибку, когда я пытаюсь запустить свои Java-программы? Программы успешно скомпилируются, но не могут быть запущены. Я уже установил путь Java.
17 ответов
это должен быть внутренний файл JRE, и в целом вы не должны иметь дело с ним при запуске/компиляции java.
Здесь вы можете найти объяснение того, для чего именно предназначен этот файл. В конце концов, ваша установка Java каким-то образом повреждена, поэтому, чтобы сначала решить эту проблему, я предлагаю вам переустановить jre.
Вы должны убедиться, что вы устанавливаете правильный jre для своей архитектуры.
Надеюсь, это поможет
Не думаю, что это правильный способ. (возможно, правильная установка Java — это постоянное решение). но это трюк. )
Удалите файл «java.exe» из «c:windows» и «c:windowssystem32». Это должно исправить его.
Вы не можете удалить/переустановить JRE, если у вас есть эта ошибка. Поэтому, поскольку предыдущая установка скопировала 3 файла, а именно Java.exe, Javaw.exe, javaws.exe в папку c:/windows/system32. Просто зайдите туда и удалите эти файлы и загрузите новую версию jre из oracle и установите ее. Я предпочту обновление JDK 1.6 45. Это очень стабильно.
Это произошло для меня, когда я переместил установку по умолчанию из переполненного основного раздела в другое место. Пихта
Java загадочно сломалась на моем рабочем ПК после того, как исправление безопасности было вытолкнуто нам, давая эту ошибку всякий раз, когда вы пытались запустить Java-программу. Так или иначе, подкаталог «lib» установки Java 7 исчез! Возможно, это связано с тем, что одновременно установлено несколько версий Java.
Если вы получаете эту ошибку, есть две вещи, которые могут быть неправильными:
1) Ваша установка Java нарушена. Если файл/каталог, на который он жалуется, не существует, удалите и переустановите JRE, а затем он должен быть там. Это исправило это для меня.
2) Если файлы есть, ваш PATH каким-то образом неверен или указывает на старую/сломанную установку Java. В этом случае вам нужно либо исправить свой PATH, чтобы указать на правильный файл java.exe/javaw.exe, либо использовать полный путь. Поэтому вместо:
3) Если ваш PATH правильный, и файлы там, и он все еще не работает, путь может быть усечен, потому что он слишком длинный. см.: Запуск Java дает» Ошибка: не удалось открыть `C:Program FilesJavajre6libamd64jvm.cfg ‘».
Программа может быть скомпилирована, но во время ее запуска приводит к такой ошибке:
Не удалось открыть C:Program FilesJavajre6libamd64jvm.cfg
Указывает, что в файлах программы отсутствует файл jvm.cfg. Причинами могут быть повреждение файла или файл может быть удален. Установите JRE снова в папку «Program Files».
Другой случай, который произошел со мной, заключается в том, что я установил 32-разрядный jdk и jre в 64-разрядную систему в Program Files (x86), а папка Program Files была пуста. В этом причина этой ошибки. Поэтому я установил 64-битную JRE в папку Program Files и начал работать. Обратите внимание, что это не связано с версией jdk. Связан только с проблемой JRE.
Я хочу добавить несколько указателей здесь.
Всякий раз, когда вы сталкиваетесь с сообщением об ошибке » Could not open jvm.cfg , это означает, что произошел некоторый беспорядок с java installation path . Ниже могут помочь подходы.
Если Java добавлен в путь к среде, откройте командную строку и введите where java . Если вы получите список каталогов, где указан путь Java. Кроме каталога, в котором вам нужен файл Java, удалите файлы Java во всех других каталогах.
Если вы читаете 2-й указатель, то 1-й указатель, возможно, не помог. Введите regedit в диалоговом окне запуска и в разделе HKEY_LOCAL_MACHINE перейдите в softwares/javasoft и переименуйте пути к установленному каталогу java.
Дайте мне знать, если вышеуказанные подходы решат проблему.
Источник
Java Hungry
Java developers tutorials and coding.
[Solved] Error Could Not Open jvm.cfg
If you are facing the error could not open jvm.cfg then do not worry. It has a simple but weird fix.
I faced the same issue when I tried to run a simple java program. I was using the jdk8. The interesting fact was that the program compiled successfully. But when I was executing the java program then it was giving Error: could not open C:Program FilesJavajre8libamd64jvm.cfg.
In short, below is the scenario
Let’s find out the solution/fix.
Fixed- Error: could not open C:Program FilesJavajre8libamd64jvm.cfg
1. Go to below folder
2. Remove below files from this folder
java.exe,
javaw.exe,
javaws.exe
3. Run the program again, voila, the error is resolved.
If the above problem does not resolve even after deleting the .exe files, then, try this
2. PATH is not correct
1. Put below the line at the beginning of the PATH.
voila, the error is resolved.
If the above problem still persists, then
3. Remove Oracle directory executable files
Check the below directory
and remove the java related executables.
voila, the error is resolved.
If you are reading this line it means, you are still facing this annoying error. So the last trick is
4. Uninstall Java, Remove references to it from Registry and Reinstall it
Источник
Запуск Java дает «Ошибка: не удалось открыть C: Program Files Java jre6 lib amd64 jvm.cfg» »
После нескольких лет работы нормально, я внезапно получаю это сообщение при попытке запустить JVM:
Я попытался удалить, и получил сообщение о том, что DLL отсутствует (не указано). Попытка переустановить, все безрезультатно.
В то же время, пытаясь запустить Scala, я получаю:
проверено %JAVA_HOME% и %path% — оба ОК
Может кто поможет?
задан 17 мая ’11, 17:05
Похоже, ваша JVM повреждена или ваш PATH загрязнен. JVM, которую вы думаете, что используете, может быть не той JVM, которую вы должны запускать. попробуйте запустить java -version, чтобы узнать, 1.6.0_xx. — Raze
Как это связано со Scala? — Rodney Gitzel
Я даже не могу выполнить java -version, не получив сообщения! — Highland Mark
Это связано со scala в том, что scala тоже не работает. Оба произошли одновременно. — Highland Mark
вот что я нашел в гугле. Может, поможет: ссылке — tonek
21 ответы
Причина может быть немного другой, но эта вторая проблема возникает у меня в scala 2.9.0.1 на Win7 (x64), хотя scala-2.9.1.final уже решила эту проблему, упомянутую здесь:
My %JAVA_HOME% установить такой путь: c:program files (X86) Javajdk.
Обратите внимание на пробел и круглые скобки.
Если вы измените строку 24 в %SCALA_HOME%binscala.bat из:
Работает нормально. Обратите внимание на кавычки вокруг установленных параметров команды, это будет правильно заключать любые пробелы и «специальные» символы (например, пробелы и круглые скобки) в значение переменной.
Надеюсь, это поможет кому-то другому, ищущему ответ.
+1, но то же самое следует применить и к файлу:% SCALA_HOME% bin scalac.bat — Израиль Унтерман
Благодарность! в моем случае я переименовал раздел Windows, в котором была установлена Java. Отмена этого изменения исправила его. — асс
Я проверил свои переменные среды — JAVA_HOME и PATH, и все они относятся к C: java. Так что это было немного неприятно. Через некоторое время я обнаружил, что установка по умолчанию также скопировала java.exe, javaw.exe и javaws.exe в C: Windows System32 (т.е. удаление JRE не прошло успешно). Я просто удалил их и вуаля, я снова на ходу. Эта досадная ошибка больше не появляется.
Это работает для меня
Итак, если существует, удалите java.exe, javaw.exe и javaws.exe из System32
ответ дан 02 мар ’18, в 11:03
Я не понимаю, почему Oracle / Sun решили сделать это и не исправить деинсталлятор. Спасибо. — махдуми
Просто удалил всю папку C: / Windows / jre, что позволило использовать правильный java exe дальше по пути. Понятия не имею, что установило java в мой каталог Windows и поместило его в путь: | — Дедрон
Моя ситуация: Eclipse перестал запускаться. Proguard не загружается из-за отсутствия файла jvm.cfg. Удалены windows / jre и упомянутые выше exe-файлы. Решил мою проблему. Это произошло случайно за последнюю неделю. Никакого объяснения этому. — Кносский
Это сработало после того, как я удалил java.exe, javaw.exe и javaws.exe из C: Windows System32. Спасибо @ Full-Stack Software Engineer. Вы сэкономили мне время. — НабРадж_Байтади
поместите% JAVA_HOME% bin в начало PATH.
У меня такая же проблема в Windows, хотя мои PATH и JAVA_HOME были в порядке. Перемещение% JAVA_HOME% в начало PATH решило эту проблему. Спасибо! — Самуил
Несмотря на это, я получал ошибку. Чего я не заметил, так это то, что когда я открывал приглашение CMD, он по умолчанию был C: Windows System32, который содержал проблемную установку java. Переход в любой другой каталог заставит Java нормально работать с JDK, который я хотел на пути. — СумасшедшийПингвин
У меня была такая же проблема: у меня 64-битная Windows, и когда я набрал «java -version» в CMD-Console, я получил то же сообщение об ошибке. Попробуйте запустить 64-битный cmd (C: Windows SysWOW64 cmd.exe) и вы увидите, там он работает;)
ответ дан 27 апр.
Я сделал резервную копию файлов в нем и удалил эти файлы оттуда. Затем я открыл новое приглашение cmd, и оно отлично работает.
У меня было несколько иное решение этой проблемы. мой PATH и JAVA_HOME указывали на JDK12 в
но выполнение команды:
Мне пришлось удалить папку с исполняемыми файлами (Java.exe, javaw.exe и т. Д.) В другом каталоге, чем System32, как предлагали другие ответы здесь и сообщения в блогах. Вместо этого я обнаружил, что проблема заключается в исполняемых файлах, найденных в:
Если у вас возникла эта проблема и в System32 ничего нет, проверьте упомянутый выше каталог «общих файлов» на наличие каталога oracle и удалите его.
После этого ваши ссылки на PATH должны работать нормально!
ответ дан 18 авг.
Проверьте путь «C: Program Files (x86) Common Files Oracle Java javapath», возможно, вы установили какую-то программу, которая автоматически устанавливает Java. — Кумар Абхишек
Вау, это действительно сработало! — Про какашки
Если раньше это работало, значит, PATH больше не правильно.
Это может произойти, когда PATH становится слишком длинным и обрезается.
Все сообщения (нравится вот этот) предложить обновление PATH , который вы можете сначала протестировать в отдельном сеансе DOS, установив минимальный путь и посмотрев, снова ли там работает java.
Наконец, исправлено удалением java, удалением всех ссылок на него из реестра и повторной установкой.
ответ дан 23 мая ’17, 11:05
Спасибо. Я все еще не могу это разобрать. С минимальным путем (path =% JAVA_HOME% bin) он работает — однако, как вы говорите, я не вижу проблемы в фактическом пути, который является «. ;% JAVA_HOME% bin; . «, который содержит то же самое. — Хайленд Марк
Наконец удалось удалить старые версии JRE с помощью JavaRA и MSICUU2.exe, перезагрузить последнюю версию, но все равно сообщение. — Хайленд Марк
@Highland: если это работает с минимальным путем, но не с полным путем, это означает %JAVA_HOME%bin не проблема. Другой элемент в PATH вызывает сбой среды выполнения. Не могли бы вы попробовать PATH вы бы строили по одному элементу, чтобы увидеть, когда Java перестанет запускаться? — ФонК
Спасибо VonC — это дает мне над чем поработать. Я отчитаюсь. — Хайленд Марк
Это не было на пути. Наконец, исправлено удалением java, удалением всех ссылок на него из реестра и повторной установкой. Никто не стал мудрее, но снова заработал. Спасибо всем. — Хайленд Марк
Я подумал, что поделюсь, как я решил ту же проблему «Ошибка не удалось открыть lib amd64 jvm.cfg». Я обнаружил, что во время выполнения Java Jre7 отсутствует папка amd64 в lib. Однако у меня есть 1.7.0_25 JDK, в котором есть папка jre, а также amd64.
Я переместил исходное содержимое папки jre7 в файл резервной копии и скопировал все из 1.7.0_25 jre.
Теперь я больше не получаю эту ошибку и могу продолжить работу с построителем сцены.
ответ дан 09 авг.
Установка Java 7 на моем рабочем ПК прервалась после того, как нам был принудительно отправлен патч, что вызывало эту ошибку каждый раз, когда вы пытались запустить программу Java. Каким-то образом весь подкаталог lib установки Java 7 исчез! Возможно, это связано с установкой как Java 6, так и Java 7 — в каталоге jre6 все еще было все.
В любом случае я исправил это, удалив как Java 6, так и Java 7 и переустановив только Java 7. Но если файл, на который он жалуется, действительно существует, то у вас, вероятно, возникла проблема с путем, как описано в некоторых других ответах здесь .
за исключением того, что в моем случае переустановка JRE не заменила отсутствующий lib папка 🙁 — Давид
Ах . Я переустановил 64-битную JRE, но оказалось, что была также установлена 32-битная JRE. Я удалил оба — они все равно были на пару уровней исправлений — затем переустановил 64-битную JRE (только), и теперь все в порядке. — Давид
Внезапно возникла та же проблема, от одного дня к другому затмение сказал
после попытки запустить java на консоли
теперь я просто удалил весь каталог
и все снова заработало . не знаю, откуда взялась эта jre, надеюсь, это не вирус
Источник
- the
Could Not Open jvm.cfg
Error in Java - Fix the
Could Not Open jvm.cfg
Error in Java
Sometimes, we think everything is working as expected, but some issues are behind the scenes. Today, we will discuss a similar situation and determine possible solutions.
the Could Not Open jvm.cfg
Error in Java
This error occurred when we updated our machine to Windows 10 but later reverted to Windows 8 for a few reasons. All the applications worked fine, but we had an issue running Java Programs.
Whenever we try to compile the Java program, it compiles successfully, but as soon as we run this, it gives an error as follows.
Example Code (We are using JDK 8
):
C:>javac test.java
C:>java test
Error: could not open C:Program FilesJavajre8libamd64jvm.cfg
Fix the Could Not Open jvm.cfg
Error in Java
There are a few possible solutions for this. Let’s have a look at each of them below.
Solution 1: Remove .exe
Files From the System32
Folder
Go to the folder System32
, which resides in the C:Windows
location.
Remove the java.exe
, javaws.exe
, and javaw.exe
from the folder. The error is gone; now, run the program again to get your desired results.
If this solution does not work for you even after deleting the .exe
files, then go for the following solution.
Solution 2: Make Sure the Java PATH
Is Correct
The other reason can be having an incorrect Java Path. So, write the following line at the start of the PATH
.
The error must be resolved. If the error persists, then we can try the following solution.
Solution 3: Delete Oracle Directory Executable Files
Go to the following directory.
C:Program FilesCommon FilesOracle
Start looking for the executable files related to Java. Remove them if you find them.
Now, the error is resolved. If you are still reading this article, the error still annoys you.
So, go for the final solution, which is given below.
Solution 4: Uninstall Java and Reinstall It
The final solution is to uninstall Java. Make sure that you remove the references to it from the Registry
and then reinstall it.
This trick must work, and you must eliminate the error now.
-
Partition Wizard
-
Partition Manager
- Fixed: Java Virtual Machine Launcher Error in Minecraft & Eclipse
By Ariel | Follow |
Last Updated August 16, 2022
A lot of users encounter the Java Virtual Machine launcher error when running some Java programs like Minecraft and Eclipse. Don’t worry. This post of MiniTool explores several proven ways to fix the JVM launcher error.
What Does Java Virtual Machine Launcher Error Mean
Java Virtual Machine, also known as JVM, is a virtual environment that allows a computer to run Java programs written in other programming languages that are translated to Java bytecode. Without the JVM, Java programs won’t run properly. Here’s a user who encountered the Java Virtual Machine launcher error in Eclipse.
I’m having an issue with the eclipse JVM launcher. Last night, everything was working fine, as far as I know, nothing at all has changed on my pc since then. However, I woke up this morning to find that when I run any of my projects in eclipse, I receive this error: Java Virtual Machine Launcher- Error: could not open C:Program FilesJavajre1.8.0_60libamd6jvm.cfg
https://stackoverflow.com/questions/33324363/how-to-fix-eclipse-java-virtual-machine-launcher-error
After analyzing extensive user reports, the Java Virtual Machine launcher errors mainly occurs when running in Eclipse and Minecraft. It’s so annoying that the failed to create the Java Virtual Machine error will prevent you from opening the Java-based software.
The error usually indicates that your computer cannot read or understand the bytecode you’re trying to execute. There are different possible reasons behind the Minecraft could not create the Java Virtual Machine error, such as insufficient permissions, corrupt/missing Java components, and incompatibility issues.
How to Fix the Java Virtual Machine Launcher Error
How to fix the Java Virtual Machine launcher errors? Here we summarize some effective fixes. You can try them in order until the JVM error gets fixed.
# 1. Add a New System Variable for Java
Many users reported that Minecraft could not create the Java Virtual Machine error can be resolved by adding a new system variable for Java. You may have a try.
Step 1. Type system variable in the Search box and select Edit the system environment variables from the Best match.
Step 2. In the pop-up window, navigate to the Advanced tab and click on Environment Variables.
Step 3. Click on New under the System variables window.
Step 4. Input _JAVA_OPTIONS in the Variable name box, and then input –Xmx512M in the Variable value box and click on OK to save the change. This will increase RAM allocation to 512 megabytes for Java.
Step 5. Click on OK in the Environment Variables window.
Once done, restart the program and check if the Java Virtual Machine launcher error Minecraft disappears.
# 2. Run Java as an Administrator
The “failed to create Java Virtual Machine” error can occur due to insufficient admin rights. Here you can follow the steps below to run the program with admin rights.
Step 1. Right-click the Java executable file and select Properties. If you can’t find the file, type Java in the search box, right-click the Java icon, and select Open file location.
Step 2. In the Properties window, go to the Compatibility tab and select the Run this program as an administrator option.
Step 3. Click on Apply and then on OK to save the change.
Now, you can relaunch the program and see if the “failed to create the Java Virtual Machine” error gets fixed.
# 3. Reinstall Java
Sometimes the Java Virtual Machine launcher errors can occur due to corrupted or outdated Java components. In this case, you can try reinstalling Java and see if it works.
Step 1: Press Win + S to open Search. Then search for Control Panel and launch it.
Step 2: In Control Panel, select View by: Category in the upper right corner. Then click Uninstall a program.
Step 3: Select each Java-related program from the list and then click Uninstall. Follow the onscreen instructions to finish the process.
Step 4. Once uninstalled, you can go to the Java official website, download the latest version and install it. If you don’t know how to do that, refer to one of the tutorials:
Java Runtime Environment Download and Install for Windows 10/11
Java Virtual Machine (JVM) Download & Install for Windows 10/8/7
Download, Install, and Update Java 32 Bit & 64 Bit [JDK vs JRE]
Further Reading: Do you want to manage your partition and disk on Windows effectively? MiniTool Partition Wizard is a good choice that can help you extend/resize/delete partition, convert a disk to MBR/GPT, migrate OS, etc. Besides, it can help fix various problems such as C drive full, and corrupt file system. Perhaps you need such a tool.
About The Author
Position: Columnist
Ariel is an enthusiastic IT columnist focusing on partition management, data recovery, and Windows issues. She has helped users fix various problems like PS4 corrupted disk, unexpected store exception error, the green screen of death error, etc. If you are searching for methods to optimize your storage device and restore lost data from different storage devices, then Ariel can provide reliable solutions for these issues.
Disclosure: This article may contain affiliate links. When you purchase, we may earn a commission.
Hello guys, if you are getting «Error: could not open ‘C:Javajre8libamd64jvm.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 FilesJavajre8libamd64jvm.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 FilesJavajre8libamd64jvm.cfg’
Then I checked my environment variables, JAVA_HOME, and PATH and they all refer to C:Program FilesJava. So this bit frustrating. After some time, I found that the default installation also copied java.exe, javaw.exe, and javaws.exe to C:WindowsSystem32 (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:Javajre7libi386jvm.cfg’ — Solution
If you are facing the same problem i.e. getting the Error: could not open ‘C:Javajre7libi386jvm.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 FilesJavajre8libamd64jvm.cfg’ error:
1) Go to C:WindowsSystem32
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:Javajre7libi386jvm.cfg’.
That’s all about how to fix this error: could not open ‘C:Program FilesJavajre8libamd64jvm.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)