We have a desktop based swing app running fine with oracle jdk1.8. After moving to openjdk11 we got some not found exceptions for classes com.sun.java.swing.Painter, we resolved that by generating a bundle jar which contains some classes of com.sun.java.swing.Painter.java and some 4-5 classes and added it by
java --patch-module java.desktop=custombundle.jar -classpath path_of_jars starter_class
Now everything works fine with AdoptOpenJDK11 or opendjdk11 on windows systems. But on linux (ubnutu-64 bits or any ARM based linux environments) we got another class not found/No class def exceptions related to com.sun.java.swing.plaf.windows.WindowsLookAndFeel from the third party libraries we used.
We can not remove the calls to com.sun.java.swing.plaf.windows.WindowsLookAndFeel because they are in 3rd party libs. The company providig the libs and also other forum sites suggest adding:
--add-exports java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED
java --add-exports java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED --patch-module java.desktop=custombundle.jar -classpath path_of_jars starter_class
but after adding this get a warning such as
WARNING: package com.sun.java.swing.plaf.windows not in java.desktop
and we got still the class not found exceptions for com.sun.java.swing.plaf.windows.WindowsLookAndFeel
I tried java.desktop/com.sun.java.swing.plaf.gtk instead of java.desktop/com.sun.java.swing.plaf.windows, the warning disappeared but still not working. Any suggestions?
Adopt Openjdk version: latest (11.0.8.10)
Ubuntu: 20.04 (recent)
Note: Swing Issue on Java 10 did not help