编译时如何告诉eclipse添加导出 [英] How to tell eclipse to add-exports when compiling
本文介绍了编译时如何告诉eclipse添加导出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以告诉 eclipse 添加以下命令行选项:<代码>--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED编译时.
Is it possible to tell eclipse to add the following command line option:
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
when compiling.
我认为在运行测试时也可能需要它.
I think it may also be needed when running tests.
是否也可以删除此消息:
Is it also possible to remove this message:
请注意,我尝试将这些添加到我的一个单元测试的 VM 选项中,但没有奏效.
Note that I tried to add those to the VM options of one of my unit tests but that did not work.
推荐答案
- 转到项目>属性:Java构建路径,标签库
- 选择JRE > Is Modular 节点,然后单击编辑...
- 转到标签详细信息
- 在添加的导出部分点击添加...
- 输入以下内容:
- 源模块:
jdk.compiler
- 包:
com.sun.tools.javac.tree
- 源模块:
这篇关于编译时如何告诉eclipse添加导出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文