Compiling and running Java Program

Compiling and running Java Program

Previous Home Next


These instructions are for users of the NetBeans IDE. The NetBeans IDE runs on the Java platform, which means that you can use it with any operating system for which there is a JDK 6 available.

These operating systems include Microsoft Windows, Solaris OS, Linux, and Mac OS X. We recommend using the NetBeans IDE instead of the command line whenever possible.  
 To write your first program, you'll need:

   1. The Java SE Development Kit 6 (JDK 6)

          * For Microsoft Windows, Solaris OS, and Linux:
          * For Mac OS X:

   2. The NetBeans IDE

          * For all platforms

Creating Your First Application
Create an IDE project
Add code to the generated source file
Compile the source file into a .class file
Run the program

To compile
To compile your source file, choose Build | Build Main Project from the IDE's main menu.

To Run the Program

    From the IDE's menu bar, choose Run | Run Main Project.


Previous Home Next