I'm migrating a multiplatform (Windows and Linux) desktop application from java8 to OpenJDK 11.
The code extends a Swing class and for that we define a new class that extends the WindowsTabbedPaneUI internal API class. This class is used when the application runs on Windows.
The code does the following:
   ...
   if (this.getUI() instanceof WindowsTabbedPaneUI) {
       this.setUI(new CustomWindowsTabbedPaneUI());
   }
   ...
where CustomWindowsTabbedPaneUI extends WindowsTabbedPaneUI.
This was working fine with java 8. However, now when I run on java 11 jre it throws the following exception:
java.lang.Exception: java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI
I tried using the --add-opens and --add-exports options when launching the application but I could not make it work.
I understand the reason is that the linux jre for java 11 does not include that class.
I believe that's the case since running the command below does not list the com.sun.java.swing.plaf.windows package:
java --describe-module java.desktop
Any help is appreciated.