Pick a target JDK for a freeform project in NetBeans

I know, I know, long overdue, but here it is anyway: a little tool to assist you in building and running a "freeform" project (existing Ant script) using a different JDK from what NetBeans is running on. Ant tasks like javac and the like have long supported selecting a particular JDK executable to use (means they must fork to run the tools), but few people would want to remember to set these attributes consistently. Instead, this tool uses the magic of presetdef to do it for you. The upshot is that freeform projects behave a little more like other projects.

Download the Freeform Project Extras 1.5 NBM (NetBeans 5.0+ compatible)

If you were really paranoid you could make your test target run all your unit tests in turn on each supported JDK...without leaving the IDE. But that's for you to write.

Comments:

Great tool, thanks Jesse, how about putting it on nbextras.org, so many more can benefit from it by using autoupdate :)

Posted by Thomas Zillinger on February 20, 2006 at 06:42 PM EST #

Great stuff, Jesse! There is one bug/limitation, though. If the original ant script is specified as a property in project.xml (in all the script elements) it doesn’t work. After I changed it to the actual path it worked just fine.

Posted by Mark Herkrath on February 20, 2006 at 10:56 PM EST #

I submitted the update to nbextras.org, we'll see if it gets posted. To Mark: that's right, currently it will skip over target bindings using a computed path. Probably it could handle these with a little more work. I omitted support for that for now just to get something out there, but you're right that this ought to get fixed. Note that if you are OK with importing jdk.xml directly into your normal script then you don't need to change any action bindings in project.xml, but the setup assumes that you do not want to do this. By the way if you're interested in sources: http://www.netbeans.org/source/browse/~checkout~/ant/freeform/samples/src/org/netbeans/modules/ant/freeform/jdkselection/Configuration.java

Posted by Jesse Glick on February 21, 2006 at 01:42 AM EST #

I can't seem to get this to work for me, did you ever update it to allow ant scripts to run under the JDK selected on the project? I have NetBeans running on JDK 6, but need to compile my project source against 1.5...

Posted by Bruce Bell-Myers on September 11, 2007 at 08:12 AM EDT #

Version on nbextras.org is probably obsolete. Use http://deadlock.netbeans.org/hudson/job/javadoc-nbms/lastSuccessfulBuild/artifact/nbbuild/nbms/extra/org-netbeans-modules-ant-freeform-samples.nbm instead. If you have any problems, please file bug reports with detailed steps to reproduce (Issuezilla component 'ant').

Posted by Jesse Glick on September 13, 2007 at 04:24 AM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

jglick

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today