June 2018
Beginner
722 pages
18h 47m
English
To create a .jar file with the compiled application code, go to the project root directory and run the following commands:
cd target/classesjar -cf myapp.jar com/packt/javapath/ch04demo/**
A .jar file with the classes MyApplication and SimpleMath is created. Now we can put it on the classpath and run the application again:
java -cp myapp.jar com.packt.javapath.ch04demo.MyApplication 2
The result will be displayed the same; 2 * 2 = 4.
Read now
Unlock full access