No text or picture Add-ons were added yet. How sad!
No Links were listed yet. Go ahead and share!
With our program now complete, we can compile and run it in either one of two ways. The first method is by selecting Run from the Toolbar of the IDE that you are using. It will then automatically compile and run the application and then display the text, Hello World.
The other way is to manually compile the program using a Console Window. The most convenient way to do this is to first add the JDK Bin Directory to the Path environment variable. In Windows, this can be done using the SET PATH command, and then appending the Path to your JDK installation and its Bin folder. By doing this, the Console will be able to find the Java compiler from any folder.
Now, navigate to the folder where you have your source file and run the Compiler by typing javac, followed by the complete filename. The program will be compiled into a class file called MyApp.class.
The class file contains byte code instead of machine code. So to execute it, we need to call the Java Virtual Machine or Interpreter by typing java, followed by the filename. Notice, that we used the .java extension when compiling a file, but no class extension when running it.
Before we end this section, let's take a quick look at comments. Java used the standard C++ comment notation, with both single line and multiple line commands.
In addition to these, there is the javadoc comment. These are used to generate public class documentation using a utility, which is also called javadoc.
This program was included in the JDK Bin folder, and if we run it on the MyApp file, it will generate a couple of HTML files that look like this.
Transcription by:
Scribe4you Transcription Services