"Could not create the Java virtual machine"

Hi guys,

I'm just starting plugin development in IDEA 12, following everything from http://confluence.jetbrains.net/display/IDEADEV/Getting+Started+with+Plugin+Development, then when I clicked Run, here's what I got:

-Dsun.io.useCanonCaches=false "-Xbootclasspath/a:C:/IntelliJ IDEA 12.0\lib\boot.jar" -Didea.config.path=C:\Users\user\.IntelliJIdea12\system\plugins-sandbox\config -Didea.system.path=C:\Users\user\.IntelliJIdea12\system\plugins-sandbox\system -Didea.plugins.path=C:\Users\user\.IntelliJIdea12\system\plugins-sandbox\plugins -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\IntelliJ IDEA 12.0\bin" -Dfile.encoding=windows-1252 -classpath "C:\Java\jdk1.6\lib\tools.jar;C:/IntelliJ IDEA 12.0\lib\idea_rt.jar;C:/IntelliJ IDEA 12.0\lib\idea.jar;C:/IntelliJ IDEA 12.0\lib\bootstrap.jar;C:/IntelliJ IDEA 12.0\lib\extensions.jar;C:/IntelliJ IDEA 12.0\lib\util.jar;C:/IntelliJ IDEA 12.0\lib\openapi.jar;C:/IntelliJ IDEA 12.0\lib\trove4j.jar;C:/IntelliJ IDEA 12.0\lib\jdom.jar;C:/IntelliJ IDEA 12.0\lib\log4j.jar;C:\IntelliJ IDEA 12.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.intellij.idea.Main

Could not create the Java virtual machine.

Invalid initial heap size: -Xms128m

Process finished with exit code 1

What do I miss?
Comment actions Permalink

Which JVM version are you using to run the plugin?

Comment actions Permalink

I have both Java 6 and Java 7 installed, but use Java 6 for the plugin SDK. Anyway I've resolved the issue. Here's what happened:

When I created a Run configuration for my hello world project, IDEA automatically filled in lots of stuff in "VM Options" settings. As you know, it couldn't run.

Then I downloaded an open source plugin (css-x-fire) and loaded it in IDEA, just for the sake of comparison. I created a Run configuration for it, and tried running it... it was successful. So I looked at its "VM Options" settings, and pasted it into my hello world project:

-Xmx512m -Xms256m -XX:MaxPermSize=250m

And now it runs :)

Comment actions Permalink

That's strange. -Xms128m should be a perfectly valid setting for Java 6, either 32-bit or 64-bit.


Please sign in to leave a comment.