Making Jar Files

To make an executable jar file you must create a file called In it you put something like:

Main-Class: mastermindStrategyBetter1Gui

(Substitute mastermindStrategyBetter1Gui with the name of your main class.)

then type (for example):

jar -cvfm bing.jar hangmanGUI3.class hananGUI3\$manDrawing.class hangmanGUI3\$playAgain.class dict

to run your jarfile type:

java -jar bing.jar

to see what is in your jar file type:

cat bing.jar | jar -t

To unzip your tar file type

cat bing.jar | jar -x

Sebastian Danicic BSc MSc PhD (Reader in Computer Science)
Dept of Computing, Goldsmiths, University of London, London SE14 6NW
Last updated 2015-09-04