When I run it with IntelliJ Idea – it works completely right. When I run app.jar file from output – everything works good too, but one feature, which is supported by supportLib.jar. I get java.lang.NoClassDefFoundError: sun/plugin/dom/exception/InvalidAccessException when use it.
The structure of the output is:
| D:\myprogram\
|
---> app.jar
|
---> lib\
|
---> supportLib.jar
---> anotherSupportLib.jar
The ClassPath is: lib/supportLib.jar lib/anotherSupportLib.jar
sun.plugin.dom.exception.InvalidAccessExceptionresides in$JRE_HOME/lib/plugin.jar, so you need to add$JRE_HOME/lib/plugin.jarto your classpath. I suppose that IntelliJ adds this automatically, but it is not automatically loaded by the Java runtime (unlike rt.jar).Based on the feedback from the comments, the application should be started like this: