Downloading and Installing NetBeans IDE

These instructions describe how to download and install NetBeans, a commonly used IDE for Java programming. Using an IDE means that you have all of the tools you need in one place (your "development environment") instead of having to organize things manually. Use the instructions in Step 2 to write a simple Java program called "Hello.java" and then compile and run it.

2. Writing a Hello-world Java Program in NetBeans

2.1. Correcting Syntax Error

NetBeans performs incremented compilation, as and when a source line is entered. It marked a source line with syntax error with a RED CROSS. Point your cursor at the RED CROSS to view the error message.

You CANNOT RUN the program if there is any syntax error (marked by a RED CROSS before the filename). Correct all the syntax errors; and RUN the program.

HINTS: In some cases, NetBeans shows a ORANGE LIGHT-BULB (for HINTS) next to the ERROR RED-CROSS (Line 5 in the above diagram). You can click on the LIGHT-BULB to get a list of HINTS to resolve this particular error, which may or may not work!

SYNTAX WARNING: marked by a orange triangular exclamation sign. Unlike errors, warnings may or may not cause problems. Try to fix these warnings as well. But you can RUN your program with warnings.