Java version error could not open

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. ...

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

BillRobertson42's user avatar

asked Jan 29, 2012 at 5:10

user460920's user avatar

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

Abhishek Chatterjee's user avatar

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 Hughes's user avatar

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

Community's user avatar

answered Jan 29, 2012 at 5:47

Mark Bramnik's user avatar

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 Jain's user avatar

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'» .

Community's user avatar

answered Sep 24, 2013 at 18:03

Matt's user avatar

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.
enter image description here

answered Feb 8, 2017 at 7:49

Piyush Mittal's user avatar

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

rook's user avatar

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's user avatar

j0k

22.4k28 gold badges80 silver badges89 bronze badges

answered Sep 24, 2012 at 17:19

Gaurav Shami's user avatar

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's user avatar

j0k

22.4k28 gold badges80 silver badges89 bronze badges

answered Dec 30, 2012 at 13:55

Ranjit Kumar's user avatar

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

S Chinmayi's user avatar

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

Anonymous's user avatar

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.

  1. 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.

  2. If you are reading 2nd pointer, then 1st pointer might have not helped. Type regedit in run dialog and under HKEY_LOCAL_MACHINE, go to softwares/javasoft and rename the paths of the java installed directory.

Let me know if above approaches solve the problem.

Agilanbu's user avatar

Agilanbu

2,7312 gold badges28 silver badges33 bronze badges

answered Dec 14, 2018 at 10:33

Naveen Bhupathi's user avatar

  • The simple Solution is just uninstall the javaSE and reinstall 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 select properties >> Advanced system settings >> under Advance tab >> last option Environment Variables..>>path >> edit >> past >> ;(not required if win10)/(required if windows 7)

Agilanbu's user avatar

Agilanbu

2,7312 gold badges28 silver badges33 bronze badges

answered Jun 14, 2017 at 5:47

Surendra Kumar's user avatar

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

Shygar's user avatar

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

aswathy sali's user avatar

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 john's user avatar

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

tresf's user avatar

tresftresf

6,5545 gold badges38 silver badges97 bronze badges

Error:could not open jvm.cfg

Copying and pasting i386jvm.cfg from a different PC will resolve the issue.

Adam Michalik's user avatar

Adam Michalik

9,56512 gold badges67 silver badges102 bronze badges

answered Dec 2, 2015 at 14:55

Sarun Sherief's user avatar

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

Andrushenko Alexander's user avatar

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's user avatar

Agilanbu

2,7312 gold badges28 silver badges33 bronze badges

answered Jan 31, 2016 at 19:20

Kanon13's user avatar

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

BillRobertson42's user avatar

asked Jan 29, 2012 at 5:10

user460920's user avatar

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

Abhishek Chatterjee's user avatar

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 Hughes's user avatar

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

Community's user avatar

answered Jan 29, 2012 at 5:47

Mark Bramnik's user avatar

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 Jain's user avatar

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'» .

Community's user avatar

answered Sep 24, 2013 at 18:03

Matt's user avatar

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.
enter image description here

answered Feb 8, 2017 at 7:49

Piyush Mittal's user avatar

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

rook's user avatar

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's user avatar

j0k

22.4k28 gold badges80 silver badges89 bronze badges

answered Sep 24, 2012 at 17:19

Gaurav Shami's user avatar

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's user avatar

j0k

22.4k28 gold badges80 silver badges89 bronze badges

answered Dec 30, 2012 at 13:55

Ranjit Kumar's user avatar

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

S Chinmayi's user avatar

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

Anonymous's user avatar

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.

  1. 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.

  2. If you are reading 2nd pointer, then 1st pointer might have not helped. Type regedit in run dialog and under HKEY_LOCAL_MACHINE, go to softwares/javasoft and rename the paths of the java installed directory.

Let me know if above approaches solve the problem.

Agilanbu's user avatar

Agilanbu

2,7312 gold badges28 silver badges33 bronze badges

answered Dec 14, 2018 at 10:33

Naveen Bhupathi's user avatar

  • The simple Solution is just uninstall the javaSE and reinstall 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 select properties >> Advanced system settings >> under Advance tab >> last option Environment Variables..>>path >> edit >> past >> ;(not required if win10)/(required if windows 7)

Agilanbu's user avatar

Agilanbu

2,7312 gold badges28 silver badges33 bronze badges

answered Jun 14, 2017 at 5:47

Surendra Kumar's user avatar

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

Shygar's user avatar

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

aswathy sali's user avatar

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 john's user avatar

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

tresf's user avatar

tresftresf

6,5545 gold badges38 silver badges97 bronze badges

Error:could not open jvm.cfg

Copying and pasting i386jvm.cfg from a different PC will resolve the issue.

Adam Michalik's user avatar

Adam Michalik

9,56512 gold badges67 silver badges102 bronze badges

answered Dec 2, 2015 at 14:55

Sarun Sherief's user avatar

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

Andrushenko Alexander's user avatar

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's user avatar

Agilanbu

2,7312 gold badges28 silver badges33 bronze badges

answered Jan 31, 2016 at 19:20

Kanon13's user avatar

После нескольких лет работы нормально, я внезапно получаю это сообщение при попытке запустить JVM:

Error: could not open `C:Program FilesJavajre6libamd64jvm.cfg'

Я попытался удалить, и получил сообщение о том, что DLL отсутствует (не указано). Попытка переустановить, все безрезультатно.

В то же время, пытаясь запустить Scala, я получаю:

Javajdk1.6.0_25binjava.exe was unexpected at this time.

проверено %JAVA_HOME% и %path% — оба ОК

Может кто поможет?

21 ответы

Причина может быть немного другой, но эта вторая проблема возникает у меня в scala 2.9.0.1 на Win7 (x64), хотя scala-2.9.1.final уже решила эту проблему, упомянутую здесь:

Javajdk1.6.0_25binjava.exe was unexpected at this time.

My %JAVA_HOME% установить такой путь: c:program files(X86)Javajdk...

Обратите внимание на пробел и круглые скобки.

Если вы измените строку 24 в %SCALA_HOME%binscala.bat из:

if exist "%JAVA_HOME%binjava.exe" set _JAVACMD=%JAVA_HOME%binjava.exe

в

if exist "%JAVA_HOME%binjava.exe" set "_JAVACMD=%JAVA_HOME%binjava.exe"

Работает нормально. Обратите внимание на кавычки вокруг установленных параметров команды, это будет правильно заключать любые пробелы и «специальные» символы (например, пробелы и круглые скобки) в значение переменной.

Надеюсь, это поможет кому-то другому, ищущему ответ.

Создан 06 июн.

Я проверил свои переменные среды — 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

поместите% JAVA_HOME% bin в начало PATH.

Создан 08 ноя.

У меня была такая же проблема: у меня 64-битная Windows, и когда я набрал «java -version» в CMD-Console, я получил то же сообщение об ошибке. Попробуйте запустить 64-битный cmd (C: Windows SysWOW64 cmd.exe) и вы увидите, там он работает;)

ответ дан 27 апр.

C:ProgramDataOracleJavajavapath

Я сделал резервную копию файлов в нем и удалил эти файлы оттуда. Затем я открыл новое приглашение cmd, и оно отлично работает.

Создан 18 июн.

У меня было несколько иное решение этой проблемы. мой PATH и JAVA_HOME указывали на JDK12 в

C:Program FilesJava

но выполнение команды:

Java -version

выдал ошибку:

Error: could not open `C:ProgramFilesJavajre1.8.0_212libamd64jvm.cfg'

Мне пришлось удалить папку с исполняемыми файлами (Java.exe, javaw.exe и т. Д.) В другом каталоге, чем System32, как предлагали другие ответы здесь и сообщения в блогах. Вместо этого я обнаружил, что проблема заключается в исполняемых файлах, найденных в:

C:Program FilesCommon FilesOracle 

поскольку в

C:WindowsSystem32

Если у вас возникла эта проблема и в System32 ничего нет, проверьте упомянутый выше каталог «общих файлов» на наличие каталога oracle и удалите его.

После этого ваши ссылки на PATH должны работать нормально!

ответ дан 18 авг.

Если раньше это работало, значит, PATH больше не правильно.

Это может произойти, когда PATH становится слишком длинным и обрезается.
Все сообщения (нравится вот этот) предложить обновление PATH, который вы можете сначала протестировать в отдельном сеансе DOS, установив минимальный путь и посмотрев, снова ли там работает java.


Наконец, ОП Хайленд Марк заключает:

Наконец, исправлено удалением java, удалением всех ссылок на него из реестра и повторной установкой.

страшный ;)

ответ дан 23 мая ’17, 11:05

Я подумал, что поделюсь, как я решил ту же проблему «Ошибка не удалось открыть 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. Но если файл, на который он жалуется, действительно существует, то у вас, вероятно, возникла проблема с путем, как описано в некоторых других ответах здесь .

Создан 24 сен.

Внезапно возникла та же проблема, от одного дня к другому затмение сказал

Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll"`.

после попытки запустить java на консоли

Error: could not open `C:WINDOWSjrelibamd64jvm.cfg' 

теперь я просто удалил весь каталог

C:WINDOWSjre

и все снова заработало … не знаю, откуда взялась эта jre, надеюсь, это не вирус

ответ дан 20 апр.

У меня была такая же проблема в Затмение и я исправил это, изменив JRE с 64 бит на 32 бит:

Окно> Настройки> Java> Установленные JRE> Добавить …> Далее> Каталог> выберите «C: Program Files (x86) Java jre1.8.0_65» вместо «C: Program Files Java jre1.8.0» _60 «

ответ дан 26 окт ’15, 07:10

  • У меня была аналогичная проблема (попытка запустить ведомый агент Jenkins в Windows) на Windows 2008R2, Java 1.7.0_15

  • У меня были две ситуации, которые способствовали возникновению проблемы, и их изменение устранило ее:

    1) Установка Java в unix-совместимый путь (изменение с c:Program Files... to c:Software...); Я не думаю, что это напрямую повлияло на проблему, описанную в этой ветке, но отмечу изменение;

    2) Бег Java не через ярлык. Первоначально это не удалось с помощью ярлыка, но re-running из прямого исполняемого файла (C:SoftwareJava...binjava) работал.

ответ дан 15 дек ’18, 11:12

Переустановка java мне не помогла. Но хитрость в том, чтобы поместить переменную JAVA_HOME в начало env-vars. Проблема возникла после обновления с jdk1.7.0_11 до jdk1.7.0_13.

Создан 12 фев.

Другой обходной путь — использование короткого пути в окнах:

  1. откройте командную консоль Windows с помощью cmd.exe
  2. На c:
  3. введите команду> dir program* /x
  4. он должен отображаться как короткий путь, например: PROGRA~2
  5. so C:PROGRA~2 такой же как C:Program Files (x86)
  6. в вашей JAVA_HOME заменить путь на:
    C:PROGRA~2Javajre7

Это должно работать в среде Windows 64, как это работало для меня в 7-битной версии win64.

Создан 12 июн.

Я изменил путь установки Java с c:Program Files (x86)java в другую папку, например c:javajdk1.7 и обновил %Java_HOME% и значения пути соответственно, это сработало.

пример

%JAVA_HOME% = C:javaJDK1.7

path-C:javaJDK1.7bin; 

ответ дан 24 окт ’14, 05:10

У меня возникла эта проблема после обновления вашего java. Лучший способ решить эту проблему — просто зайти в свой c:/ProgramFiles/Java папка. Там вы найдете две папки jre, одна из которых соответствует вашей версии jre, а другая — в точности как папка jdk. Попробуйте удалить jre.1. Папку с вашей версией. Итак, ваша проблема решена. Надеюсь, это поможет. У меня это сработало.

ответ дан 30 окт ’15, 06:10

Обычно это связано с обновлением JRE.

Он изменяет символические ссылки на C: ProgramData Oracle Java javapath

Intall JDK — это исправит.

ответ дан 24 окт ’16, 22:10

Error: could not open `C:Program FilesJavajre6libamd64jvm.cfg'

Глядя @ it, проблема с пост-установочным скриптом существует и распространяется, поскольку я использую обновление jdk8 1.8.0_191, так как проблема возникла у меня после установки обновления java, и это произошло автоматически.

Error: could not open `C:Program FilesJavajre1.8.0_191libamd64jvm.cfg'

В этом случае это никогда не закончится, и вам нужно будет найти обходной путь, например, изменить путь вручную.

Создан 15 ноя.

Удалите jar-файлы в system32 для windows. Удалите банки в папке C: Program Files Common Files Oracle

Отредактируйте переменную среды, установите JAVA_HOME и SET PATH в bin

Создан 15 ноя.

Это не было на пути. Наконец, исправлено удалением java, удалением всех ссылок на него из реестра и повторной установкой. Никто не стал мудрее, но снова заработал. Спасибо всем @Highland Mark. Не могли бы вы рассказать мне, как удалить ссылки из реестра? Я перепробовал все возможные способы, упомянутые здесь, ничего не сработало.

ответ дан 22 апр.

Если вы скачали несколько JDK, вам необходимо удалить все, кроме JDK, который вы хотите использовать!

Создан 31 июля ’20, 10:07

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

java
scala

or задайте свой вопрос.

  1. the Could Not Open jvm.cfg Error in Java
  2. Fix the Could Not Open jvm.cfg Error in Java

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):

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.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Java util concurrent timeoutexception как исправить
  • Java update error 1618
  • Java update error 112
  • Java update did not complete error code 1603 что делать
  • Java update did not complete error code 1601 что делать

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии