Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ant support for java 9 addmods option

Tags:

I am trying to compile my java project with Java 9. I am using the java.xml.bind package so I need to use the -addmods option for compiling. Ant 1.9.7 does not seem to support this new feature. Does ant support -addmods option for Java 9 compiler?

like image 557
user3375401 Avatar asked Sep 01 '16 15:09

user3375401


1 Answers

There is no explicit support in any released version of Ant at this point in time. But you should be able to use <jvmarg> for that

<java ....>
    <jvmarg value="--add-modules"/>
    <jvmarg value="module.name.to.add"/>
    <jvmarg ..../>
</java>

If you are asking about <javac> rather than <java>, <compilerarg> can be used instead.

There are quite a few ways that Java 9 manages to break Ant - and 1.9.8 and 1.10.x will contain a lot of fixes for it (there will be new releases soon once the last known issues have been ironed out). Right now there is no explicit support for --add-modules, though, only for modulepath and upgrademodulepath which have been added in Ant 1.9.7.

IMHO - Would be a good enhancement request though.

like image 180
Stefan Bodewig Avatar answered Oct 03 '22 15:10

Stefan Bodewig