This section provides a tutorial example on how to compile a Java program using the 'javac' tool without any options.
To test the compiler, I wrote my first Java program with a text editor:
class Hello {
public static void main(String[] a) {
System.out.println("Hello world!");
}
}
Then I saved this program with the file Hello.java in a working directory C:\herong
Here is what I did in a command window to compile Hello.java with the 'javac' Java compiler tool.
The output of the compilation is a Java class file called Hello.class: