BlueJ
A free Java Development Environment
1What is BlueJ
BlueJ is an IDE (Integrated Development Environment).
It includes:
- an editor, which you use to write your programs
- a debugger, to help you find your mistakes
- a viewer, to see the parts of your program
- an easy way to run Java programs
- an easy way to view documentation
2To use it at Home:
- Windows download:
- Mac OSX download:
- Linux (Debian/Ubuntu) download:
3. Very Brief Introduction
3.1 Starting-up
Start BlueJ and
create a new Project:
3.2 Give the Project a name
3.3 Create a ‘class’
Think of a ‘class’ as a container that holds your first program.
You get this:
The brown ‘Hello’ box represents your program.
3.4 Editing
Double-click on the ‘Hello’ class box to open the program editor. Delete all the text that is there and replace it with this text:
public class Hello
{
public static void main (String args[])
{
System.out.println("Hello World!");
}
}
The program should now look like this (The colours get added automatically):
3.5 Compiling
Bring up both BlueJ windows next to each other. Then click on the ‘Compile’ button in one of them. Compiling produces a program that can run. If you program code has not faults you should see that the stripes in the brown box disappear.
3.6 Running
Right-click on the brown ‘Hello’ Box to open up the context menu shown:
A click on ‘void main(String[] args)’ brings up:
Just click ‘OK’ to see your program running:
3.7 Closing and re-starting
Close BlueJ. You don't have to Save your work—BlueJ does that automatically for you when you compile and before you exit.
If you quit BlueJ and come back later, BlueJ will open the last project by default. You can also use ‘Project’ -> ‘Open Project’ to work on a different project.
4The next steps
We have prepared a number of Java exercises for you on Blackboard. They are all packaged into zip file.
- Unzip them to a convenient location
- You can then either start them in BlueJ (‘Project’ -> ‘Open Project’) or simply navigate into the project folder an double-click on the ‘’package.blueJ’ file
In each project double-click on the document icon To see the task that we want you to do.
THAT’S IT – GET GOING!
1 | Page