2

OS: Windows 7 32-bit, Java: Java 7

  1. I have downloaded a jnlp file
  2. Double click on downloaded JNLP to run

jnlp file was not executed. The following error was shown at pop up:

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit

I also tried to execute from command prompt as follows:

  1. Execute the batch file containing the following command:
    echo "Running Content Studio on Java 7"............
    javaws -uninstall
    "C:\Program Files\Java\jdk1.7.0_25\jre\bin\javaws.exe" http://cbazyx.com/studio/Test.jnlp

But unfortunately same error occurred: Could not create the Java Virtual Machine.

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176

1 Answers1

2

I have solved it as follows:

Open downloaded Studio.jnlp on an editor. I found the following line in my Studio.jnlp:

<j2se version="1.7.0_13+" 
  java-vm-args="-Xms128m -Xmx2048m" 
  href="http://java.sun.com/products/autodl/j2se"/>  

Where max-heap-size is not defined.

I defined initial-heap-size and max-heap-size as below:

<j2se version="1.7.0_13+" 
  initial-heap-size="100m" 
  max-heap-size="512m" 
  java-vm-args="-Xms128m -Xmx2048m" 
  href="http://java.sun.com/products/autodl/j2se"/>

Finally, Save and double click on Studio.jnlp

It was successfully executed.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
  • Related link: http://stackoverflow.com/questions/3285915/java-webstart-max-heap-size-causes-jvm-cannot-be-started – Ripon Al Wasim Oct 02 '13 at 06:45
  • The 2nd element is illogical. It sets an initial heap size of both 128 Meg and 100 Meg, and a maximum size of both 512 Meg and 2048 Meg. I'd guess the JRE that is running it is ignoring the `java-vm-args` and using the other two (which is why it now works), but the entire `java-vm-args` should be removed. Also, be sure to check the JNLP using [JaNeLA](http://pscode.org/janela/). It would not have spotted that error, but will identify many others that are common in JNLP files. – Andrew Thompson Oct 02 '13 at 20:45