From yesterday I receive the message: "Failed to create the java virtual machine" in all Java applications in my Windows machine. Maybe I had a virus or something similar. The only advice I found on other sites is to set the heap size to a lower value. The problem is that I have big applications running that requires at least 1024M heap size. Also my machine has 4GB Ram so I think that it isn't a too low memory problem.
-
2First, if your java program can't even start running I have a hard time believing it's running out of heap space. Second how are you running your program? (command line, netbeans, eclipse... other?) – Shaded Mar 03 '11 at 15:49
-
Yes they work before yesterday. I can't execute Maven, Eclipse, SQLDeveloper and Tomcat! – Alessandro Dionisi Mar 03 '11 at 15:59
8 Answers
Carefully move the current JDK / JRE installation to one side, and install a fresh copy. If it works, you are done. If not, you have eliminated the possibility that this is a corrupted installation.
Another possibility is that this is really a path problem. Can you run java -version
from a command prompt? Can you compile and run a Java "hello world" program from the command line?
Yes, in theory it could have had a virus ... or someone could have tinkered with the installation.

- 698,415
- 94
- 811
- 1,216
-
I tried to reinstall the JDK/JRE but the problems still remains. – Alessandro Dionisi Mar 03 '11 at 16:02
There are a few sites listing that error that differentiate between the heap and perm space. If you're running this through eclipse, try removing the default perm space value in the eclipse.ini: --launcher.XXMaxPermSize 256m

- 1,347
- 1
- 14
- 26
Sun JVM needs contigous memory block. In windows this could a problem due to dll-rebasing. http://www.drdobbs.com/184416272;jsessionid=HJJRNPUURRDIZQE1GHPCKHWATMY32JVN
Is there any thing else changed?
We got similar problem we installed some new applications(guess it was Citrix) on it. A tool we used was from here http://www.codeproject.com/KB/DLL/RebaseDLLs.aspx (download the code and modify)
If it is left to you, then consider moving to 64bit jvm.

- 18,003
- 15
- 89
- 143
-
1Ok, I think that this is the problem. There is some tool to help me to rebase all the Windows DLLs? The problem is related to http://stackoverflow.com/questions/171205/java-maximum-memory-on-windows-xp – Alessandro Dionisi Mar 04 '11 at 08:16
Same problem even i was facing when i first started eclipse.. Just change the value of "–launcher.XXMaxPermSize" in eclipse.ini file..
The eclipse.ini file should now look like this:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.jee.product
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
–showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
–launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

- 11
- 1
It is because Eclipse cannot find the path of javaw.exe
Just edit "eclipse.ini" file, adding this path:
Open the file and attach following sentences (replacing with your own path if different): -vm C:\Program Files\Java\jdk1.7.0_03\bin\javaw.exe
Sample:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm C:\Program Files\Java\jdk1.7.0_03\bin\javaw.exe
-vmargs
-Xms40m
-Xmx384m

- 1,015
- 1
- 10
- 25