I have the same problem when upgrade my IDEA to 2019.3.1. And the Biao's solution works for me too.
Best, Jark On Thu, 21 Nov 2019 at 22:23, 刘建刚 <liujiangangp...@gmail.com> wrote: > Thank you very much. It works for me. > > > 在 2019年11月14日,下午1:06,Biao Liu <mmyy1...@gmail.com> 写道: > > > > Hi, > > > > I have encountered the same issue when setting up a dev environment. > > > > It seems that the my Intellij (2019.2.1) unexpectedly activates java11 > > profile of maven. It doesn't match the Java compiler (JDK8). I'm not sure > > why it happened silently. > > > > So for me, the solution is "Intellij" -> "View" -> "Tool Windows" -> > > "Maven" -> "Profiles" -> uncheck the "java11" -> reimport maven project. > > > > Thanks, > > Biao /'bɪ.aʊ/ > > > > > > > > On Mon, 4 Nov 2019 at 18:01, OpenInx <open...@gmail.com> wrote: > > > >> 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 > >> > >> > >> On Mon, Nov 4, 2019 at 5:44 PM Till Rohrmann <trohrm...@apache.org> > wrote: > >> > >>> Try to reimport that maven project. This should resolve this issue. > >>> > >>> Cheers, > >>> Till > >>> > >>> On Mon, Nov 4, 2019 at 10:34 AM 刘建刚 <liujiangangp...@gmail.com> wrote: > >>> > >>>> 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? > >>>> > >>> > >> > >