Jvm cfg ошибка

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 Files\Java\jre6\lib\amd64\jvm.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:\windows\system32″. 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 Files\Common 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)\Java\jdk1.8.0_221\bin» 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,6921 gold badge11 silver badges10 bronze badges

3

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

40.1k4 gold badges57 silver badges97 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,96926 silver badges36 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>\bin\java.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 Files\Java\jre6\lib\amd64\jvm.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:\Windows\System32 which was pointing to jre6 and my default location of jre was pointing to this(C:\Windows\System32) 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,8601 gold badge21 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 Windows\System32 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_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

win64:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment

answered May 24, 2019 at 12:19

rook's user avatar

rookrook

5,8904 gold badges39 silver badges52 bronze badges

The program can be compiled but while running it leads to such an error:

Could not open C:\Program Files\Java\jre6\lib\amd64\jvm.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.6k28 gold badges79 silver badges90 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:\Users\kranjit>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Program Files\Java\jre6\bin;C:\Program Files (x86)\Java\jre6\bin;

j0k's user avatar

j0k

22.6k28 gold badges79 silver badges90 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:\windows\system32 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,7672 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 Files\Java\jdk1.8.0_131\bin.

  • 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,7672 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,22310 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

5524 silver badges12 bronze badges

I had an identical error trying to start IntellJ with a custom JBR.

C:\Users\user>"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.3\bin\idea.bat"

Error: could not open `C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.3\jbr-arm64\lib\jvm.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

7,1036 gold badges40 silver badges101 bronze badges

Error:could not open jvm.cfg

Copying and pasting i386\jvm.cfg from a different PC will resolve the issue.

Adam Michalik's user avatar

Adam Michalik

9,69813 gold badges71 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:\ProgramData\Oracle\Java\javapath 

In the folder there were 3 exe files:

java.exe
javaw.exe
javaws.exe

When I removed the the entry

C:\ProgramData\Oracle\Java\javapath

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 Files\Java\jre1.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,7672 gold badges28 silver badges33 bronze badges

answered Jan 31, 2016 at 19:20

Kanon13's user avatar

Тема: Проблема в лаунчере

  1. 10.08.2016, 10:38


    #1

    Проблема в лаунчере

    Error: could not open `C:\Users\Nikita\AppData\Roaming\.minecraftonly\ja va\Java\lib\i386\jvm.cfg’ Незнаю что делать
    зарание спасибо


  2. 10.08.2016, 11:48


    #2

    EzgaC, Попробуй скачать Java 7, вот ссылка http://www.java.com/ru/download/
    или же зайди в пуск напиши %appdata% зайди в папку Roaming удали папку MinecraftOnly
    и скачать клиент/ Launcher заново вот ссылка http://minecraftonly.ru/download.html

    Последний раз редактировалось EugeneTokarev; 10.08.2016 в 11:58.


  3. 10.08.2016, 11:56


    #3


  4. 10.08.2016, 16:44


    #4

    Удали папку Java в .minecrafonly, а так же последуй совету игрока выше — установи Java 7.


  5. 10.08.2016, 21:10


    #5

    Большое спасибо


Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)


Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  • BB коды Вкл.
  • Смайлы Вкл.
  • [IMG] код Вкл.
  • HTML код Выкл.

Правила форума

Java загадочно сломалась на моем рабочем ПК после того, как исправление безопасности было вытолкнуто нам, давая эту ошибку всякий раз, когда вы пытались запустить Java-программу. Так или иначе, подкаталог «lib» установки Java 7 исчез! Возможно, это связано с тем, что одновременно установлено несколько версий Java.

Если вы получаете эту ошибку, есть две вещи, которые могут быть неправильными:

1) Ваша установка Java нарушена. Если файл/каталог, на который он жалуется, не существует, удалите и переустановите JRE, а затем он должен быть там. Это исправило это для меня.

2) Если файлы есть, ваш PATH каким-то образом неверен или указывает на старую/сломанную установку Java. В этом случае вам нужно либо исправить свой PATH, чтобы указать на правильный файл java.exe/javaw.exe, либо использовать полный путь. Поэтому вместо:

java <whatever>

Использование

c:\<full path to correct JRE>\bin\java.exe <whatever>

3) Если ваш PATH правильный, и файлы там, и он все еще не работает, путь может быть усечен, потому что он слишком длинный. см.: Запуск Java дает» Ошибка: не удалось открыть `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg ‘».

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 Files\Java\jre6\lib\amd64\jvm.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:\windows\system32″. 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 Files\Common 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)\Java\jdk1.8.0_221\bin» 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,6921 gold badge11 silver badges10 bronze badges

3

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

40.1k4 gold badges57 silver badges97 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,96926 silver badges36 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>\bin\java.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 Files\Java\jre6\lib\amd64\jvm.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:\Windows\System32 which was pointing to jre6 and my default location of jre was pointing to this(C:\Windows\System32) 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,8601 gold badge21 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 Windows\System32 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_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

win64:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment

answered May 24, 2019 at 12:19

rook's user avatar

rookrook

5,8904 gold badges39 silver badges52 bronze badges

The program can be compiled but while running it leads to such an error:

Could not open C:\Program Files\Java\jre6\lib\amd64\jvm.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.6k28 gold badges79 silver badges90 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:\Users\kranjit>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Program Files\Java\jre6\bin;C:\Program Files (x86)\Java\jre6\bin;

j0k's user avatar

j0k

22.6k28 gold badges79 silver badges90 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:\windows\system32 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,7672 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 Files\Java\jdk1.8.0_131\bin.

  • 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,7672 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,22310 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

5524 silver badges12 bronze badges

I had an identical error trying to start IntellJ with a custom JBR.

C:\Users\user>"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.3\bin\idea.bat"

Error: could not open `C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.3\jbr-arm64\lib\jvm.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

7,1036 gold badges40 silver badges101 bronze badges

Error:could not open jvm.cfg

Copying and pasting i386\jvm.cfg from a different PC will resolve the issue.

Adam Michalik's user avatar

Adam Michalik

9,69813 gold badges71 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:\ProgramData\Oracle\Java\javapath 

In the folder there were 3 exe files:

java.exe
javaw.exe
javaws.exe

When I removed the the entry

C:\ProgramData\Oracle\Java\javapath

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 Files\Java\jre1.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,7672 gold badges28 silver badges33 bronze badges

answered Jan 31, 2016 at 19:20

Kanon13's user avatar

В программировании, что-то может пошло не так. Часто, даже если вы успешно написали свою программу, необходимо будет научиться ее запускать. В этой статье мы рассмотрим одну из самых распространенных проблем, связанных с запуском Java-файлов — Error: could not open `…\jvm.cfg’.

Первым шагом в решении этой проблемы является понимание, что такое jvm.cfg. Файл jvm.cfg — это файл конфигурации Java Virtual Machine (JVM), который определяет, какая версия JVM будет использоваться при запуске программы.

Обычно файл jvm.cfg находится в папке \lib\amd64 (или \lib\i386, если у вас 32-разрядная операционная система), которая находится в установочной папке Java. Если этого файла не существует, или если он находится в неправильном месте, то при запуске Java-программы вы можете столкнуться с ошибкой «could not open `…\jvm.cfg'».

Существует несколько способов решить эту проблему:

1. Проверьте, установлена ли JDK

Первым шагом является установка Java Development Kit (JDK). JDK — это пакет, который содержит все необходимые файлы для разработки и запуска Java-программ. Если вы не установили JDK, то необходимо загрузить и установить его с официального сайта.

2. Проверьте путь к jvm.cfg

Если файл jvm.cfg существует, но находится в неправильной папке, вы должны перенести его в правильное место. Убедитесь, что файл jvm.cfg находится в папке \lib\amd64 (или \lib\i386, если у вас 32-разрядная операционная система), которая находится в установочной папке Java.

3. Проверьте переменную PATH

Еще одной причиной, по которой вы можете столкнуться с ошибкой «could not open `…\jvm.cfg'» является то, что переменная PATH не установлена правильно. Переменная PATH — это список путей к папкам, в которых операционная система ищет исполняемые файлы.

Чтобы исправить эту ошибку, вы можете добавить путь к установочной папке Java в переменную PATH. Чтобы это сделать, следуйте этим инструкциям:

1. Откройте меню «Пуск», нажмите правой кнопкой мыши на «Компьютер» и выберите «Свойства».
2. В левой части окна нажмите на «Дополнительные параметры системы».
3. В открывшемся окне выберите вкладку «Дополнительно».
4. На вкладке «Переменные среды» найдите переменную PATH и нажмите «Изменить».
5. Добавьте путь к установочной папке Java в конец строки, разделенный точкой с запятой. Например:
C:\Program Files\Java\jdk1.8.0_221\bin;
6. Нажмите «ОК» во всех открытых окнах.

4. Проверьте версию Java

Если выполненные мероприятия не помогли решить проблему, она может быть связана с тем, что программа использует другую версию JVM, чем та, которая у вас установлена на компьютере. Чтобы проверить версию Java, установленную на компьютере, выполните эти действия:

1. Откройте командную строку (нажмите клавишу Win + R, введите cmd и нажмите Enter).
2. В командной строке введите команду: java -version
3. Нажмите Enter.

Информация о версии Java будет выведена в командной строке. Если программа, которую вы пытаетесь запустить, использует другую версию Java, чем та, которая у вас установлена, то вам необходимо установить правильную версию Java.

В заключение, если вы столкнулись с ошибкой «could not open `…\jvm.cfg'», это может быть связано с несколькими причинами. Убедитесь, что JDK установлен правильно, переместите файл jvm.cfg в правильную папку, проверьте переменную PATH и убедитесь, что программа, которую вы пытаетесь запустить, использует правильную версию JVM. Если вы все еще не можете запустить свою программу, обратитесь за помощью к специалистам. Но преимущественно, проблема может быть решена самостоятельно, используя инструкции выше. Счастливого программирования!

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

Интересное по теме:

  • Jvc ошибка e06
  • Jvc выдает ошибку магнитола warning chk
  • Jvc kd x150 ошибка
  • Jvc kd sh909r ошибки
  • Jvc kd r47 ошибка

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

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