2

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...

PKay
  • 433
  • 3
  • 9
  • 20

2 Answers2

1

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

EDIT:

Execute the main class in .jar application,

java -jar Application.jar

KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
  • that was already set to the class name which has the main() method.. that is why it works in my pc. – PKay Sep 29 '09 at 06:34
0

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.

Dhawal Saiya
  • 25
  • 1
  • 6