Contents
This toturial will create your very first Java program under Mac OS.
Prerequest
-
JDK 1.8
-
Text Editor
Outline
-
Writing a program and save it as
HelloWorld.java
-
Using
javac
command compile this java file to class file. -
Using
java
command to run the program and checkout the result
Component
HelloWorld.java
public class HelloWorld{
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Using javac
to compile this file to class file
Using java
to run the program