cannot compile Java 9 module with --patch-module in IntelliJ IDEA 2017.2.1

后端 未结 1 388
灰色年华
灰色年华 2021-02-07 01:39

I am trying to acquaint myself with Java 9 modules and how to define them in IntelliJ. Among other things, I want to solve a split package problem using the --patch-modul

1条回答
  •  北海茫月
    2021-02-07 02:28

    Well eventually with the following configuration of the IntelliJ(Fix version of IDEA-169150) -

    IntelliJ IDEA 2018.1 (Community Edition)
    Build #IC-181.4203.550, built on March 27, 2018
    JRE: 1.8.0_152-release-1136-b20 x86_64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    macOS 10.13.3
    

    and the Java Compiler settings for the project as the one in the following screenshot:-

    • Override compiler paramaters per-module
    • Select the module
    • Add the compilation option to patch (Note - I've used the latest version of the jar)

      --patch-module com.effjava.collect=/Users/naman.nigam/.m2/repository/com/google/guava/guava/24.1-jre/guava-24.1-jre.jar
      

    Post this select Build > Build Project and the build completes successfully(though I still see RegularImmutableList in MyImmutableList as red) for me.

    0 讨论(0)
提交回复
热议问题