CHAPTER 2

image

Compile and Run

Running from the IDE

With your Hello World program complete you can compile and run it in one of two ways. The first method is by selecting run from the menu bar of the IDE that you are using. In Netbeans the menu command is: Run ➤ Run Main Project. The IDE will then compile and run the application, which displays the text “Hello World”.

Running from a console window

The other way is to manually compile the program by using a console window (C:\Windows\System32\cmd.exe). 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 by using the ...

Get Java Quick Syntax Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.