Deploying netbeans applications - jar file error (could not find main class)

I have a small GUI application developed with netbeans.

I used the "clean and build" option to create an executable jar..jar file is running on my computer. But when I sent the app to my friend, he says he throws "can't find main class error".

What could be the reason?

Thanks in advance...

+2


source to share


2 answers


Open the project property, select run and set the Main-Class attribute (text box).

EDIT:



Implement the main class in the .jar app,

java -jar Application.jar

+1


source


If you have used any library, try providing the library jar files along with the jar file. For example, if your libraries are present in the supposed lib folder then give the complete lib folder along with the jar file.



0


source







All Articles