Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error creating Runnable jar in eclipse

Tags:

java

eclipse

I have a project that I'd like to make a Runnable Jar from. I have a Run Configuration that works from within Eclipse. When I try to Export a Runnable Jar, I get this error for every .jar the project uses: "Fat Jar Export: Could not find class-path entry for "

Any ideas on what I need to do to make this work?

like image 897
Srikanth M Avatar asked Jan 05 '12 12:01

Srikanth M


2 Answers

I had same problem, and solution is fairly easy. Just right-click to your project, select Properties -> Java Build Path, then open Libraries tab, click on Add External JARs and then select all of the libraries you need (the ones that you got the error message, in my case it was derbyclient.jar), confirm with OK. Then in Package Explorer you will get Referenced Libraries and there will be all of additional libraries that you need to export project into runnable JAR:

enter image description here

From unknown reasons Eclipse will not add them automatically even if you configured them properly in Project -> right click -> Run As -> Run Configurations -> Classpath tab. You have to add manually all of the libraries that you need with Add External JARs

like image 150
Nenad Bulatović Avatar answered Sep 20 '22 05:09

Nenad Bulatović


I was able to solve this issue by deleting the .project and .classpath, etc hidden files created by eclipse in my project directory. And then closing the project and importing the project a new.

I took 2 days to solve this.But this works!

like image 33
user3769875 Avatar answered Sep 21 '22 05:09

user3769875