Sadia Khan
Sadia Khan

Reputation: 3

Generated JAR file is not executing

I have a java project which reads data from an the excel sheet (specified by the user), performs some filtering and creates a few text files and then writes the modified data to the text files.

The project is working fine and now I want to create a jar file for it. I created the jar file but it did not run. As far as the code is concerned it is running without any errors.I have used Netbeans for GUI. I also saw related questions which said it is not possible to create a text file from a running jar.

Is there a workaround?

Upvotes: 0

Views: 1633

Answers (1)

sul
sul

Reputation: 267

You need to specify the main class in the manifest of the jar file.

If you have an application bundled in a JAR file, you need some way to indicate which class within the JAR file is your application's entry point. You provide this information with the Main-Class header in the manifest, which has the general form: Main-Class: classname

http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html

Upvotes: 1

Related Questions