By following the steps on this page, you can create and use a standalone Java application.
Create a Java source file
Create a file named HelloWorldApp.java with the Java code shown here:class HelloWorldApp { public static void main (String args[]) { System.out.println("Hello World!"); } }Compile the source file
Compile the source file using the Java compiler.If compilation succeeds, the compiler creates a file named HelloWorldApp.class. If compilation fails, make sure you typed in and named the program exactly as shown above.
Run the application
Run the program using the Java interpreter.You should see "Hello World!" displayed on the standard output.
What next?
Now you can either:
- Go to the next lesson, The "Hello World" Applet, which steps you through writing an applet.
- Learn more about the Java language and about writing applications by going to the Writing Java Programs trail.