To execute the Hello application from the command line, enter: java Hello Make sure that Hello is capitalized as shown. If you entered the command correctly, you should see the output: hello world
Each time you compile the source file, the Java compiler will replace any associated class file that already exists. Only where pertinent in this book (for example, when I discuss classpath) do I demonstrate use of the javac and java commands. I highly recommend that you familiarize yourself with command-line compilation and execution. The Java compiler and VM work virtually the same across all platforms. If you have difficulty compiling and executing code within your IDE, you will have to refer to the documentation for your IDE. |