0

I'm trying to migrate my swing project from Java 8 to Java 11. I encountered a problem with IDEA GUI Designer plugin. When I try to build the project, I get following error:

[ERROR] Failed to execute goal org.codehaus.mojo:ideauidesigner-maven-plugin:162.2038.2:javac2 (default) on project stockbox-provider-ib: command execution failed: Forms instrumentation failed for /Users/maciej/stockbox/providers/ib/src/com/goodsoft/stockbox/ib/view/IBConnectForm.form: /Users/maciej/stockbox/providers/ib/src/com/goodsoft/stockbox/ib/view/IBConnectForm.form: Class not found: javax.swing.JPanel -> [Help 1]

Until now, I was dealing with it by providing bootclasspath VM argument with paths to rt.jar and jce.jar in JRE, which includes Swing classes like below:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>

            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <encoding>${project.build.sourceEncoding}</encoding>
                <executable>${env.JAVA_HOME}</executable>
                <compilerArguments>
                    <bootclasspath>${env.JAVA_HOME}/jre/lib/rt.jar:${env.JAVA_HOME}/jre/lib/jce.jar</bootclasspath>
                </compilerArguments>
            </configuration>

Since Java 9 JDK no longer includes JRE, so I can't point them. Moreover, Java 9+ doesn't support bootclasspath VM argument. I have tried adding rt.jar and jce.jar from JDK 8 as global libraries in IntelliJ, but it didn't solved the issue. I have also tried to point this jars in JDK 8, but it didn't worked either.

Any ideas for a workaround?

Maciej
  • 1
  • JDK 11 is _modular_. You need to research ___module path___ The module containing _Swing_ is `java.desktop` – Abra Jul 14 '20 at 09:57
  • @Abra I've changed plugin configuration like below to add module java.desktop, but with no success. The issue is present only while building to be precise. `--add-modules=java.desktop` – Maciej Jul 14 '20 at 14:20

0 Answers0