编译时如何告诉eclipse进行添加导出 [英] How to tell eclipse to add-exports when compiling

查看:243
本文介绍了编译时如何告诉eclipse进行添加导出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以告诉eclipse添加以下命令行选项:

--add-exports jdk.compiler / com.sun.tools.javac.tree =

我认为在运行测试时也可能需要它。

>

是否也可以删除此消息:



请注意,我试图将这些添加到我的一个单元测试的VM选项中,但是没有用。

解决方案


  1. 转到 项目>属性:Java构建路径 ,然后选择 Libraries

  2. 选择 JRE>模块化 节点,然后单击 Edit ... li>
  3. 转到选项卡 详细信息

  4. 添加的出口中部分点击 添加...

  5. 输入以下内容:


    • 源模块: jdk.compiler

    • 包装: com.sun.tools.javac.tree



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:

Note that I tried to add those to the VM options of one of my unit tests but that did not work.

解决方案

  1. Go to Project > Properties: Java Build Path, tab Libraries
  2. Select the JRE > Is modular node and click Edit...
  3. Go to the tab Details
  4. In the Added exports section click Add...
  5. Enter the following:
    • Source module: jdk.compiler
    • Package: com.sun.tools.javac.tree

这篇关于编译时如何告诉eclipse进行添加导出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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