Reputation: 51
It should be simple but I can't run my JAR file.
My error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/pdfbox/pdmodel/font/PDFont
I'm trying to follow some post like this: Stackoverflow
But nothing.
I think this error is because I haven't take external libraries on my project.
How to create a JAR file with libraries in Intellij ?
Anyone have a solution ?
Upvotes: 1
Views: 3582
Reputation: 709
Click on
File -> Project Structure->Artifacts->'+'->Jar->From modules with dependencies
-> Select the module folder and Main Class.Click on Apply and then you export the artifact
Now with all the required libraries in the class path your program should work as expected
Upvotes: 0
Reputation: 59
After adding the dependencies, you can export your project as jar if you wish.
extract Jar
If you still get the error, please cross check your classpath for the missing class, you might have got classnotfound exception or ExceptionInInitializerError before.
Upvotes: 1