0

I have been working on a .jar file and it was running on double click.

I installed the JRE 7 and it got errors. I uninstalled the JRE 7 and changed the .jar files to open with javaw.exe now it get the error could not find main class.

I used Netbeans to create the .jar file please help I'm stuck here

Now I having JDK 6 with net beans 7.2 .

The program runs property from the command line.

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
user763274
  • 59
  • 1
  • 1
  • 3
  • 1
    You can take a look at this thread. [Stack overflow thread][1] [1]: http://stackoverflow.com/questions/5428079/could-not-find-the-main-class-when-double-clicking-jar-file – tausun Sep 25 '12 at 06:23
  • 1
    Make sure that you've allowed for parameters to past to `javaw.exe`. It reads `"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*` on my Windows 7 box – MadProgrammer Sep 25 '12 at 06:28
  • Can u tell me how to set parameters to java.exe -jar – user763274 Sep 25 '12 at 08:44

1 Answers1

0

Make sure that the manifest file inside the jar contains the main-class field and the corresponding class name by opening in archive.

Munesh
  • 1,509
  • 3
  • 20
  • 46