2

I have a Java code that can run correctly in eclipse.

enter image description here enter image description here

I need to run this java program outside eclipse, so I tried to export it as executable jar file.

enter image description here

I have one warning poped up: enter image description here

Then, I have JAR creating failed error with Resource is out of sync message.

enter image description here

What might be wrong? What's the command to execute the java program outside the eclipse?

ADDED

Googling ( Eclipse source out of sync with file system ) to remove the resource is out of sync error, but I have many duplicate errors.

enter image description here

Why do I have these errors? How can I remove them? I downloaded the project from mercurial repository.

Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871

2 Answers2

0

I could generate the executable jar, this is the summary that I had to do in order to make it work.

Removing the duplicate file.

I found some error messages saying that there are duplicate files. I couldn't understand why eclipse thinks there are duplicate files, but by removing the files, I could remove the errors.

Excluding some of the files

In Build -> Configure Build Path enter image description here

I had to remove or exclude source folders.

enter image description here

Always sync by refreshing

I had to use F5 key to refresh the build, or I could do that automatically using eclipse setup : enter image description here

prosseek
  • 182,215
  • 215
  • 566
  • 871
0

Do you have a situation like: Project A is referring to B & C. C is also referring to B and you are trying to create a runnable jar for A?

This was causing the problem for me. I some how managed to remove the dependency of C in A and that helped!