Netbeans – running programs the easy wayMarch 31st, 2009 | by Toomas Römer | |
I have not been so angry at an IDE for a while, arrrrrrrghhh, rant follows.
How hard can it be to add JVM arguments to the run configuration of an application when running it from an IDE? Lets say I want to add -Dsuperboost=true or just ~/myconf/.myconf to the Java application?
Eclipse has a green button and Run configurations under it, there you can specify Program arguments and VM arguments. Easy.
IntelliJ Idea has a green button and Edit Configurations under it, there you can specify Program parameters and VM parameters. Easy.
Netbeans has a green button. Thats it. Where are the options? When you check project Properties there is Build » Compiling & Packaging but no run. Googling for such a generic topic does not help me much, just aggrevates more.
Finally I realize, everything is ANT based, I’ll just modify the build.xml files used. The toplevel build.xml includes project/nbproject/build-impl.xml, this includes some NetBeans bundled build.xml. Okay, this is not the best place.
I find a file named project.properties with two options in it, javac.compilerargs and javac.source. Jackpot, I’ve found the hidden settings, I just need to figure out the magic names that I could add. Some more googling and trying out different flags from different NetBeans versions I’m still out of luck, I’m unable to guess the names.
Finally I went through NetBeans/harness/build.xml » common.xml » run.xml and the magic secret hidden flags follow:
run.jdkhomerun.args.commonrun.args.preparedrun.argsrun.args.extra
Weeehah! Now I need only to add “-noverify”. No, more like “-J-Xverify:none”, argghh.