This is "Hello World" Example for Java.
The structure HelloWorld
package is like this:
example.java.helloworld/ |-- HelloWorld | `-- Main.java |-- LICENSE |-- Manifest.txt `-- README.md
For compile the main class for package, execute the follow command:
javac HelloWorld/Main.java
This generate the Main.class
file into HelloWorld
directory.
For run the main class for package, execute the follow command:
java -cp . HelloWorld.Main
This show the Hello world
message.
For pack the main class for package as a JAR file, execute the follow command:
jar cfme Main.jar Manifest.txt HelloWorld.Main HelloWorld/Main.class
For run the JAR file packed, execute the follow command:
java -jar Main.jar
This show the Hello world
message.