How to tell eclipse to add-exports when compiling

房东的猫 提交于 2019-11-27 18:50:35

问题


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:


  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




回答2:


You can add the --add-exports jdk.compiler/.... options on VM Arguments as shown below.



来源:https://stackoverflow.com/questions/54068992/how-to-tell-eclipse-to-add-exports-when-compiling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!