ict1991
ict1991

Reputation: 2100

Why is the Eclipse jar file generating compile errors when the application does not have errors?

I'm trying to produce a jar file of my project using Eclipse and when I try to use it it is giving me errors as certain files are not being included in the jar file. I recompiled the project again and after generating the jar file it states that "Jar file export finished with warnings" and certain files are exported with compile warnings.

Is there another way to generate a jar file ? I tried using netbeans but its not allowing me to import the project

Upvotes: 1

Views: 10685

Answers (1)

Alan Escreet
Alan Escreet

Reputation: 3549

You can check in the project properties for the dependencies that you're using in your project environment (Project -> Properties -> Java Build Path).

If all the necessary dependencies are not included in the JAR file that you're creating and also not available on the classpath of the target system, then such errors will occur.

You can either pack the required dependencies in your JAR or deploy them separately to your target system - which method you use really depends on whether the dependencies are 3rd party libraries (they should be deployed separately) or home-grown components that are part of the system itself (they should be packaged together).

Upvotes: 2

Related Questions