Reputation: 695
I am using Eclipse to export my project into a runnable jar.
I'm using a few libraries, namely Apache commons, Java FX, and GSON.
I have added those libraries to my Build Path inside Eclipse:
When exporting, I choose to package the required libraries into the generated jar: This creates a jar called Editor.jar
However when I do "java -jar Editor.jar" I get the java.lang.ClassNotFoundException for the class EqualsBuilder which is a part of Apache commons.
I've tried copying the apache commons-lang3-3.4.jar file into the working directory. I've also tried adding "-cp commons-lang3-3.4.jar" before the "-jar". Still I always get the ClassNotFoundException.
Does anyone see what I'm missing? Thanks.
Upvotes: 0
Views: 1256
Reputation: 2545
Select that option while exporting , If u dont select that option then u might have to resolve the dependencies on your own using -cp
Upvotes: 1