Similar to this question, I am looking for a way to supply long options (i.e.
--long-option myVal) to the JVM used by ant. However, my question is different because I want to specify these JVM options to the ant process itself, not some sub-process that ant creates (e.g.
Specifically, I need to specify
--add-modules java.se.ee so that the ant tasks run by my build scripting have access to the JAXB classes.
What I have tried so far:
ant -f build.xml --add-modules java.se.ee ant -f build.xml --add-modules=java.se.ee ant -f build.xml -Dadd-modules=java.se.ee ant -f build.xml -D--add-modules=java.se.ee ant -f build.xml -propertyfile java9.properties
-propertyfile option I have tried having the contents of
and also with the key and value on separate lines:
Finally found the answer in the ant-users mailing list.
You can specify
ANT_OPTS as an environment variable and it will apply those options to the JVM (commonly used for increasing max heap size).
In my case the solution was doing:
export ANT_OPTS="--add-modules java.se.ee"