Download NetBeans!

20060124 Tuesday January 24, 2006

Set Runtime and JVM Arguments... Per Class!

Ever since writing Provide Runtime Arguments for Selected Class Files in NetBeans IDE 4.1, I've been in touch with Iván Rivera Rodríguez, from Spain. His first e-mail to me started:

This exact limitation has prompted nearly all of the co-workers to whom I pitched NB4.1 to reject it and go straight back to 3.6 --except for the Eclipse fanboys, of course ;-). Most of them aren't fond of writing Ant tasks to perform "such basic tasks, that NetBeans 3.6 performs without problems" (their words).

The e-mail continued:

Such was the humiliation (I love the new NetBeans) that I set out to learn the OpenAPIs (and anything else related) to create a module for them, providing this piece of lost functionality, the Set Arguments... command. If you are interested, I can provide sources for you to study; I am somewhat wary of publishing it as I am in no situation to handle its maintenance (you know, all work and no play...); however, it sort of works in its current form.

Since then, we've been corresponding off and on a bit now and then... until... the last week or so. We started corresponding more regularly, because he was putting the finishing touches to his module. It now works for NetBeans IDE 5.0 (except, currently it only works if you're using a post 5.0 development build that you can get from the Download page on www.netbeans.org). Once you've installed Iván's module (go to my Update Center, and you'll find a module called "Execution Profile"), all your main classes will have a new node:

You can then, for each main class, specify execution (i.e., runtime) arguments, JVM arguments, and the Java platform against which the file executes:

Not bad, right? Especially considering that this missing functionality is a stumbling block for many people—I've seen this come up over and over again on mailing lists. (By the way, there's also a NetBeans IDE 4.1 version of this module, but I haven't been able to work out how to create an autoupdate descriptor for it, so I couldn't put it in my Update Center. If you want it, please leave a message here. And, remember, the version in my Update Center will not work if you're using Beta 1, Beta 2, RC1 or RC2. You must get/have a post 5.0 development build from the Update Center.)

Finally, the module also contains a set of help files, so if you're stuck, lost, and confused, go here:

And, here's the exact spot where you'll find Iván's module:

Jan 24 2006, 07:59:09 AM PST Permalink