"Could not find or load main class" ereur when i import a JasperReport library

Answered

 

Hi, when i use the artifact to create a ".jar" file of my project (depending on JavaFX, JDBC, JasperReport libraries), and try to run it using CMD (java --module-path "Path to Javafx lib" --add-modules javafx.controls,javafx.fxml) i get the following error :

Could not find or load main class com.example.mvnjavafxwithdep.HelloApplication
Caused by: java.lang.ClassNotFoundException: com.example.mvnjavafxwithdep.HelloApplication

but when i retire the JasperReport's library it works fine, so i'm really not sure why artifact tool is not working as it should with a project using JasperReport as a dependency.
PS: i tried to export it using eclipse and it worked fine, so the issue is obviously from Intellij.
Any idea how to solve this?

Manifest content :
Manifest-Version: 1.0
Main-Class: com.example.mvnjavafxwithdep.HelloApplication

0
4 comments

It looks the library i used has a digital signature (.SF file) should I delet this file from the library ? (will this have any consequence?)

0

Yes, you should remove it, otherwise the jar will not work.

0

thank you it worked

0

Please sign in to leave a comment.