Hello World in Java
Hello World
Create HelloWorld.java
file with the following
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Compile it by
javac HelloWorld.java
Run it with:
java HelloWorld
Creating JAR file
In order to create JAR file one have to create Manifesto.txt
with
Main-Class: HelloWorld
Then, one can create jar
file with
jar cfm HelloWorld.jar Manifest.txt HelloWorld.class
and run it with
java -jar HelloWorld.jar