The first step to becoming a programmer is to set up your development environment. In Lesson 1 we learned what a compiler is, and why we need one. There are many free Java compilers available on the web. For the sake of ease, we are going to be using an Integrated Development Environment (IDE) with a built in compiler. This IDE is just a program we will use to write our very own programs, just like you may use Microsoft Word to write a letter. My IDE of choice is the Eclipse IDE. Eclipse is a completely free program we can use to write, compile, and run our Java code. The Eclipse IDE has a very nice user interface, as well as numerous tools that will make it easier to write our code. You can download it from the Links Section of this site Here.
Once you have downloaded Eclipse, simply extract the file someplace onto your computer. If you don’t know where to put them “C:\Program Files\Eclipse” is as good of a place as any. Also don’t forget to create a desktop shortcut so you can access it easily. Now go ahead and open up Eclipse!
Once open, you want to click the far-right button “Work Bench”. This will take you to the main eclipse work area, where we will spend all our time. I think the best way to learn is to jump right in and run our first program, so lets get to it:
- Choose “File”->”New”->”Project…”
- Choose “Java”->”Java Project”
- Click “Next”
- Type a name for your project, I will use “HelloProject” for this example – then click “Finish”
Now we have created our project. This is simply a place where we can keep the code for the program we are about to write. Each time we create a new program, we will first create a new project.
Now onto the actual code:
- Right click on your project name in the navigator bar on the left and choose “New”->”Class”
- In the “Name” field type “HelloWorld”
- A tab will open up in the main work area of the eclipse program with some code in it. Delete it.
- Copy the “Hello World” code (Click the “View Source” Button) example from the Examples page of this site, located here into the file we just created in eclipse.
Your Screen should now look like this:
The "Hello World" program in the Eclipse IDE
Now for the good stuff:
- Save your file by choosing “File”->”Save” – When you do this, eclipse will automatically compile your source code into byte code.
- Click the Green “Play” button that is outlined in the red box in the picture above, this will run your program.
- View the output of your program in the bottom pane titled “Console”, it should read “Hello World.”

