BlueJ is a unique integrated development environment (IDE) for teaching Java and object oriented programming, characterized by the ability of the user to interactively create objects and call their methods.
The feature that distinguishes it from all other IDEs is that the user can interactively create objects and call the methods of the created objects. In other words, the BlueJ user can play the role of an object in the running program. In fact, the BlueJ user is essentially a "super-object" because he or she has powers that other objects do not have. For example, the BlueJ user can inspect any other object, even if its instance variables have been declared private
.
There are many advantages in being able to create objects and call methods interactively:
main
method The user can directly start the program by creating an initial object and if necessary calling one of its methods. In other IDEs it is necessary to write a special method called main
whose only purpose is to start the program running.
The user can directly call methods with different arguments in order to ensure that they are working as expected. In other IDEs it is necessary to write additional methods or even classes just in order to test the code. This creates more potential for error (is it the code that is incorrect or the test?) and the temptation to skimp on testing. Interactive testing is completely natural and can be performed directly each method is completed.
Learning Java is almost always made unnecessarily complex by the problems of input/output. Java's I/O mechanism is extremely general, and it relies heavily on inheritance, exceptions and other sophisticated concepts. However input is necessary to avoid every program simply performing a "hardwired" calculation of some sort, and so students are inevitably asked to use something that they cannot initially understand. However with BlueJ, input is completely natural - whenever a method is called the user is prompted for the arguments for that method call and can enter any values. Essentially BlueJ performs the role of a black box input device, but it is much easier for students to comprehend because it is clear that BlueJ's prompt is logically part of the IDE, rather than their program.
A program written in BlueJ consists only of the classes directly relevant to the problem at hand. This means that there is a direct relationship between the problem and the computational model used for its solution. There need not be any of the overhead normally associated with small OO programs.
A program developed in BlueJ is standard Java. It can be run separately from BlueJ simply by creating a main
method that creates an object and calls a method. This has the additional positive effect that students are unlikely to code an entire program in the main
method, but realize that the only purpose of main
is to start the real program running.
The BlueJ program is itself a Java program, and so it is necessary to have Java installed on your computer in order to run BlueJ.
In CITS1200 we will be using a new version of BlueJ that support the JUnit4unit test system. First download the installation files for Java and BlueJ. You canuse the links below. I suggest that you bring in a USB thumb driveand plug it into one of our machines in the computer lab, and downloadthe files directly onto that.
Note that because of some distribution restrictions on some of thesoftware available on our download site (), we can only permit downloadsfrom machines that are on the UWA network. If you attempt to downloadfrom home you will get a "permission denied" message.
Once you have copied these files onto your home computer you shouldfirst install Java by simply double clicking on the .exe fileand following the instructions.
Once Java is installed, installation of BlueJ on Windows is simplya matter of of double-clicking on BlueJ-windows-9901junit4-4.exe
If you have problems with BlueJ, then the best way to try to resolve these is by going to the BlueJ Web site and looking at the . For problems with UWA BlueJ version see the contact details on the UWAJavaTools page.