0

I have .jar file generated from three sources:

  1. Netbeans
  2. Eclipse (using export)
  3. From cmd (jar cvmf MANIFEST.MF output.jar input1.class input2.class ...)

In the last process, I created a blank MANIFEST.MF and then the command. When the file got archived in .jar, I opened it with WinZip and edited the MANIFEST.MF. I added Main-Class:input1.

All three sources run fine on cmd through java -jar output.jar. But nothing happens on double-clicking them.

I have tried this solution as well. I also have set the default for .jar as javaw.exe but still does not run.

How to fix this?

ucMedia
  • 4,105
  • 4
  • 38
  • 46
user4275686
  • 71
  • 1
  • 9
  • did you check this: http://stackoverflow.com/questions/5827164/why-does-my-jar-file-execute-at-cmd-but-not-on-double-click? – akhil_mittal May 12 '15 at 04:12
  • check this as well ;) https://stackoverflow.com/questions/394616/running-jar-file-in-windows – Suspended May 12 '15 at 04:13
  • What is your program supposed to do? Does it load a swing gui? – shinjw May 12 '15 at 06:12
  • My program is supposed to show a sorted list of numbers. Is it necessary for jar to have GUI for it to run on double clicking? To be more clear, when I look into my jar archive using winzip, it has two `.class` files and a folder `META-INF` which contains MANIFEST.MF only. Nothing else. – user4275686 May 12 '15 at 06:18
  • when you export as jar , use the **executable jar** option . and pack all req files into it – Srinath Ganesh May 12 '15 at 06:21
  • @SrinathGanesh That I did in eclipse. Does Netbeans provide that option? – user4275686 May 12 '15 at 06:28

0 Answers0