Skip to content

Latest commit

 

History

History
33 lines (32 loc) · 652 Bytes

File metadata and controls

33 lines (32 loc) · 652 Bytes

A simple 5-mins kata which can help you to master the basics of java programm creation using CLI

$ javac -d out src/SimpleMain.java
java -cp out SimpleMain
Good start
$ jar -cvf app.jar out    # wrong, it includes the out folder to jar
$ jar -cvf app.jar -C out/ .    # correct
$ java -jar app.jar
no main manifest attribute, in app.jar
$ java -cp app.jar SimpleMain
# create a file with manifest.txt as a name and specify there Main-Class attribute
$ cat manifest.txt
Main-Class: SimpleMain
$ jar -cvfm app.jar manifest.txt -C out/ .
$ java -jar app.jar
Good start