Question

I have a small GUI application developed with netbeans.

I used the 'clean and build' option to build an executable jar file. .jar file works in my pc. But when i sent the application to my friend he says that it throws 'cannot find the main class' error.

what could be the reason?

Thanks in advance...

Was it helpful?

Solution

Open project property, select run and set Main-Class (textfield) attribute.

EDIT:

Execute the main class in .jar application,

java -jar Application.jar

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top