ant 支持 java 9 addmods 选项 [英] ant support for java 9 addmods option
问题描述
我正在尝试使用 Java 9 编译我的 Java 项目.我正在使用 java.xml.bind 包,所以我需要使用 -addmods 选项用于编译.Ant 1.9.7 似乎不支持这个新特性.ant 是否支持 Java 9 编译器的 -addmods 选项?
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?
推荐答案
此时任何已发布的 Ant 版本都没有明确的支持.但是你应该可以使用
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.
Java 9 有很多方法可以破解 Ant - 1.9.8 和 1.10.x 将包含很多针对它的修复程序(一旦解决了最后一个已知问题,很快就会有新版本发布).目前没有对 --add-modules
的明确支持,但仅支持在 Ant 1.9 中添加的 modulepath
和 upgrademodulepath
.7.
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.
恕我直言 - 不过会是一个很好的增强请求.
这篇关于ant 支持 java 9 addmods 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!