I worked on a user’s computer for a problem related to Java. It took me several hours to figure it out. In the end, it actually wasn’t directly related to Java.
There was a Java application that they’ve used for a long time. The program stopped running correctly since last week. Whenever they tried to run it, this dialog popped up.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I googled for solutions and tried several different methods. None of them worked for me. I have tried the following:
- Re-install Java: There were several versions of Java on the machine. I uninstalled all of them. and installed the latest version.
- Change value of Xmx parameter for java/javaw: Most articles I found suggested this method. The Java program that I worked on does use this parameter. The program uses -Xmx1024M to invoke javaw.exe. I tried to decrease the value. After I changed the value, the error dialog was gone. However, the program still did not run.
- System restore: I have tried this on several occasions before and this usually fixes minor problems with new programs or spyware. It did not work either.
- Safe mode: I tested the program in safe mode. This usually eliminates the problems caused by other services or programs. The Java program did not work on safe mode either.
After hours of working on this computer, I still could not fix the problem. I decided to look for any suspicious programs using the Add/Remove Programs in Control Panel. I uninstalled a bunch of programs that I knew the user did not install. These programs were related to browsing. The names were like Search Assist, Browse Redirect …. I do not remember the exact names of the programs I un-installed, but you get the idea. Afterwards, I was able to run the Java program again. The problem was solved.
If you have a similar problem, you can try to remove suspicious programs from your computer. It might fix the problem for you.