Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set VM options in a Java Netbeans Platform Modular Project?

I have a Netbeans Platform modular project, not a regular Java project. I want to set VM options to increase memory, but under the "properties" dialog, there is no way to do this for a modular Netbeans platform project. This has cost me huge amounts of time and I still have not found a good way to set the VM args.

Does anyone know how to set VM args using a Netbeans platform modular project, when compiling and running the program in Netbeans 7? Given the amount of trouble, I am almost ready to give up on Netbeans to create modular applications.

like image 257
Makoto Avatar asked Jul 11 '11 07:07

Makoto


2 Answers

It is quite easy, in fact. Just modify project.properties file to include the following line:

Edited:

run.args.extra=-J-Xmx768m

Of course, you can include any other JVM options there.

Enjoy.

like image 179
JB- Avatar answered Sep 22 '22 02:09

JB-


I was finally able to solve this based on information at https://web.archive.org/web/20130830023832/http://activeintelligence.org/blog/archive/gephi-increasing-xmx-memory-in-netbeans/

What I did was modify the project.properties file, as JB said, but the correct way to do it was to add a -J before the args. E.g.,

run.args.extra=-J-Xms256m -J-Xmx756m

That did it! Not sure why it took 3 months to figure that out. Definitely a fail for the Netbeans documentation. They should really make this editable from the properties menu instead of making users hunt through nondescript config files!

like image 44
Makoto Avatar answered Sep 22 '22 02:09

Makoto