ant对Java 9 addmods选项的支持 [英] ant support for java 9 addmods option

查看:85
本文介绍了ant对Java 9 addmods选项的支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用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中都没有明确的支持.但是您应该可以使用<jvmarg>

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>

如果您询问的是<javac>而不是<java>,则可以使用<compilerarg>.

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.7中添加的modulepathupgrademodulepath.

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.

这篇关于ant对Java 9 addmods选项的支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆