且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在IntelliJ IDEA 2017.2.1中无法使用--patch-module编译Java 9模块

更新时间:2023-01-10 14:46:58

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.