Hello, You might want to tweak which ant is used. In the options>Java>Ant (first tab) you can set the ant home to any directory you want. You could adapt or wrap the ant script (depending on your OS), By setting the JAVA_HOME environment variable to the jdk of your liking.
A strategy is to rename the ant script chosen by your OS (e.g. ant under Linux or ant.cmd on Windows) to something like ant-orig[.cmd] Then create a cmd or shell script with the contents (linux example shown) ----- #!/bin/bash ANT_HOME=.... (fill in) export JAVA_HOME=... (fill in) $ANT_HOME/bin/ant-orig "$@" ----- Met vriendelijke groet, Pieter van den Hombergh. Kerboschstraat 12 5913 WH Venlo On Tue, Nov 14, 2023 at 10:35 AM Tom Eicher <[email protected]> wrote: > Hello, > > so NB19 needs Java11+ to run, which is fine. > > But (for now) I need to run my ant task with Java8, > but it seems ant is always launched within the JVM > that runs NB. > > Testing, with Java8, on command line "ant dist" builds my ear, > whereas with Java11 I get errors like > cannot find symbol javax.annotation.Generated > which is probably expected. > > Running in NB19, I get the very same error, and no setting I > found would change this behaviour. > > Basically, I have the very same question like this one: > > https://stackoverflow.com/questions/70036683/how-to-change-java-for-ant-in-netbeans > and none of the solutions works. > > Any 5ct? > > Thanks, Cheers, Tom. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > >
