It found that execing ant is the best way to get a 1.4 javac build. I use the following presetdef:
<presetdef name="fork_ant_java14"> <java fork="yes" classname="org.apache.tools.ant.launch.Launcher" jvm="${java14_exe}"> <classpath> <path path="${ant.home}/lib/ant-launcher.jar"/> </classpath> <env key="JAVA_HOME" value="${env.JAVA14_HOME}"/> </java> </presetdef> Ant figures out where the java14 exe is set based on an enforced env variable: JAVA14_HOME. <ac:if> <available file="${env.JAVA14_HOME}/bin/java.exe"/> <ac:then> <property name="java14_exe" location="${env.JAVA14_HOME}/bin/java.exe"/> <property name="javac14_exe" location="${env.JAVA14_HOME}/bin/javac.exe"/> </ac:then> <ac:else> <property name="java14_exe" location="${env.JAVA14_HOME}/bin/java"/> <property name="javac14_exe" location="${env.JAVA14_HOME}/bin/javac"/> </ac:else> </ac:if> And the preset is used as follows: <fork_ant_java14> <arg value="-find"/> <arg value="build.xml"/> <arg value="comp_grapplet_fork"/> </fork_ant_java14> Peter On Wed, Oct 22, 2008 at 10:25 AM, Steve Loughran <[EMAIL PROTECTED]> wrote: > scuzzie wrote: >> >> Hi, >> >> I have a project written in NetBeans 6.1 that I need to be able to compile >> on demand using any JDK version from 1.4.2, on a machine that does not >> have >> NetBeans installed (but does have Ant of course). The app compiles under >> 1.4.2 and up using the Ant xml files generated by NetBeans. At the moment, >> the options are 1.4.2/1.5/1.6 as they are the JDKs that are installed on >> the >> machine. The application uses Swing so has a couple of dependant jars. >> >> Modifying the xml build files is not an option. Specifying a properties >> file >> from the Ant command-line is fine, and I have had to do this anyway (as >> well >> as copying the swing and NetBeans copylibs jars to the machine). The file >> is >> autogenerated and is created automatically before calling Ant. >> >> Are there properties I can add to my properties file to specify which >> version of the SDK to compile with? Any other suggestions? >> > > You can point Ant at a different Java version by setting JAVA_HOME. You also > have to make sure that the Java it executes is the right one, which can > usually be done by running $JAVA_HOME/bin/java . > > You could have a wrapper build.xml file that does this by using <exec> and > setting up the environment variables for the right JDK > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]