I have built an java application that use Swing and Flatlaf as theme.
When I'm running the application through the IDE(InteliJ) it's running without any problem. After I have built it succsesfully using the package command from Maven, And when I try to run it I'm receiving this error:
(I get the same result if I build it through maven-jar-plugin:3.1.0 plugin)
Error: Unable to initialize main class com.Yad2AutomationWithGUI.bouncer.Main
Caused by: java.lang.NoClassDefFoundError: com/formdev/flatlaf/FlatDarculaLaf
I have understand that it's related to the JRE and JDK that installed on the PC, So I have updated them both to the latest version and also updated the env Path for them.
C:UsersUSER>javac -version
javac 18.0.1.1
C:UsersUSER>java -version
java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
I have imported the Flatlaf repository using Maven this way:
com.formdev
flatlaf
2.2
....