Error:java: 无效的标记: --add-exports=java.base/sun.net.util=ALL-UNNAMED Hi, I am using flink 1.9 in idea. But when I run a unit test in idea. The idea reports the following error:"Error:java: 无效的标记: --add-exports=java.base/sun.net.util=ALL-UNNAMED". Everything is ok when I use flink 1.6. I am using jdk 1.8. Is it related to the java version?*来自志愿者整理的flink邮件归档
Hi I met the same problem before. After some digging, I find that the idea will detect the JDK version and choose whether to use the jdk11 option to run the flink maven building. if you are in jdk11 env, then it will add the option --add-exports when maven building in IDEA.
For my case, I was in IntelliJIdea2019.2 which depends on the jdk11, and once I re-import the flink modules then the IDEA will add the --add-exports flag even if I removed all the flags in .idea/compile.xml explicitly. I noticed that the Intellij's JDK affected the flink maven building, so I turned to use the Intellij with JDK8 bundled, then the problem was gone.
You can verify it, and if it's really the same. can just replace your IDEA with the pkg suffix with "with bundled JBR 8" in here [1]. Say if you are using MacOS, then should download the package "2019.2.4 for macOS with bundled JBR 8 (dmg)"
Hope it works for you Thanks.
[1]. https://www.jetbrains.com/idea/download/other.html*来自志愿者整理的flink邮件归档
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。