1

I have just made an executable jar file.But after being made,i found that it's not getting executed.I followed the instructions on this page ,but then also its not getting executed.

Can someone help me out of this ??

Below is the output from console.

G:\javap>jar cvf t2.jar mn.mf TicTacToe.class
added manifest
adding: mn.mf(in = 44) (out= 46)(deflated -4%)
adding: TicTacToe.class(in = 6006) (out= 2543)(deflated 57%)
Community
  • 1
  • 1
asad_hussain
  • 1,959
  • 1
  • 17
  • 27

1 Answers1

1

You must either specify the 'm' flag AND the name of the manifest file that contains Main-Class: (possibly among other things), OR the 'e' flag AND the name of the class and jar creates a manifest for you containing that Main-Class: The linked dupe does the former; notice cfm in its flags.

jar cfm t2.jar mn.mf TicTacToe.class
jar cfe t2.jar TicTacToe TicTacToe.class 
rem add v flag if you wish, it doesn't affect the jar

See http://docs.oracle.com/javase/8/docs/technotes/tools/windows/jar.html#sthref40 .

Community
  • 1
  • 1
dave_thompson_085
  • 34,712
  • 6
  • 50
  • 70