Wednesday, November 17, 2004

Ant, Java and SuSE Mixup

My "new", current, (temporary) work machine is an older box with 190MB RAM, which isn't quite up to the task of running Netbeans. (NB takes up more than that by itself.) So I've dropped back to coding in Emacs, and running the NB project Ant script (and Ant) from the command line. (I should get a better machine by next week.)

Which brings us back to the question of how to setup the taskdef classpath without using the NB dialogs. It looks like NB wires stuff up before calling Ant during builds, but doesn't make it apparent what gets wired or to what values.

I ended up using properties for the XDoclet jars, chaining them together into another property for the classpath required for a single taskdef, and putting that property into the taskdef's classpath attribute.

Then it wouldn't compile. My setup was thus: Java 1.4.2 was already installed on the machine, I then installed 1.5 manually (i.e. not via SuSE's mechanism, as they didn't have 1.5, at least in YaST), and then installed Ant via YaST. The Ant script (in /usr/bin/ant), for some reason, was assuming that I was using a 1.3 JDK, and when run, ant said "Unable to locate tools.jar. Expected to find it in /usr/lib/SunJava2-1.4.2/lib/tools.jar". Took me a while, but I found the line in /usr/bin/ant that referred to 1.3, changed it to 1.5, then looked at the setJava script, and created the proper .conf file in /etc/java. And voila, no runs, no drips, no errors.

0 Comments:

Post a Comment

<< Home