BlueJ is a configurable product. Various configuration options,
such as the editor's use of syntax highlighting and the interface
language (English, French, and so on), can be modified. Some
modifications can be made in a user context; all modifications can
be made in an administrator context. This section explores
configuration in each context.
User Configuration
Each BlueJ user can configure BlueJ to their own requirements.
BlueJ creates a separate configuration file for the user:
<USER_HOME>/.bluej/bluej.properties (Unix) or
<USER_HOME>\bluej\bluej.properties (Windows).
<USER_HOME> represents the user's home directory, such as
c:\winnt\profiles\<USER_NAME>\ (under Windows NT).
This file stores options that have been modified via BlueJ's
Preferences dialog box.
Activate Preferences by selecting Preferences from the main
window's Tools menu, or by selecting Preferences from the
editor window's Options menu. This dialog box appears in Figure
11.

Figure 11. Use the Preferences dialog box to configure user
options
The Preferences dialog box presents a tabbed interface with
Editor, Miscellaneous, Libraries, and Extensions tabs. Use
these tabs to configure a variety of options:
- Editor presents various editor-related options, such as
the font size and whether or not the editor should use syntax
highlighting.
- Miscellaneous presents documentation, unit test, and
compiler and runtime options. For example, check this tab's "Show
unit testing tools" checkbox to enable unit testing.
- Libraries presents options for adding/removing user
libraries to/from the current project's classpath. For example,
introduce a user library by clicking the Add button and by
selecting, via the file chooser, the library's directory, JAR file
or ZIP file. Another way to introduce a user library: copy the
library into the <BLUEJ_HOME>/lib/userlib directory,
where <BLUEJ_HOME> is the directory where BlueJ was
installed.
- Extensions presents options related to BlueJ's submitter
extension. I review extensions and introduce submitter later in
this article.
Note: BlueJ does not update bluej.properties until
program exit.
Administrator Configuration
It's also possible to configure BlueJ for all users by changing
<BLUEJ_HOME>/lib/bluej.defs. This configuration file
contains a list of properties in the format
property-name = value. The property
names should not be changed, but the values may be changed to alter
the configuration. You should make a backup of this file before
changing its contents.
There are many options that can be modified: interface language,
URLs for BlueJ manuals and documentation, fonts, and so on. For
example, to change the interface language from English to French,
comment out the line bluej.language=english (by
prepending a # character to that line) and uncomment
the line #bluej.language=french. Figure 12 reveals
BlueJ's main window with a French interface.

Figure 12. BlueJ supports thirteen interface languages
Note: Although all properties in bluej.defs apply to all
users on the system, properties in a user's bluej.properties
file override the equivalent properties in bluej.defs.
Extend BlueJ
BlueJ is an extensible product. You can introduce new
functionality not present in the core system by creating
extensions, JAR files whose classes interact with BlueJ via
BlueJ's Extensions API, or using extensions developed by others.
Once you have an extension JAR file, you copy that JAR file into
one of three locations, which determines the extension's scope:
- <BLUEJ_HOME>/lib/extensions: The extension is
available to all projects for all users of this BlueJ version.
- <USER_HOME>/.bluej/extensions/ (Unix) or
<USER_HOME>\bluej\extensions\ (Windows): The extension
is available to all projects for a single user.
- <BLUEJ_PROJECT>/extensions: The extension is
available to only this project for a single user
(<BLUEJ_PROJECT> is a placeholder for the name of the
project directory).
After copying the extension's JAR file to the appropriate
directory, start BlueJ. If the extension associates with a specific
project, open that project. The extension installs. As you'll
discover, extensions can add menu items to BlueJ's Tools menu,
along with the pop-up menus associated with class and object icons.
Extensions can also add new panels to the Extensions tab on the
Preferences dialog box. They can even interact with BlueJ's editor
to retrieve and modify the text in source files.
The BlueJ site presents a
number of prebuilt extensions, including an extension to
automatically check coding styles, a sequence diagram editor, a
remote file manager, an extension manager, a class evaluator, and a
submitter. Of the various listed extensions, only the submitter
extension is distributed with BlueJ.
The submitter extension makes it possible for course tutors to
have students submit their work from within the BlueJ environment,
for assistance or assessment. What gets submitted (Java source
files only, class files plus source files, and so on), how the
submission occurs (file copy, email, file transfer via FTP, and so
on), and to whom the submission is sent to can be configured by the
course tutor. All that the student needs to configure, by way of
the Extensions tab on the Preferences dialog box, are the name of
the SMTP server for submissions sent by email, the student's email
address, and the student's username. Learn more about the submitter
extension, by reading the article "The BlueJ Submitter Extension" (see
Resources).
At some point, you will probably want to create your own
Java-based extension. The BlueJ site offers a helpful article in
this regard, "Writing Extensions For BlueJ" (see Resources). That article walks you through the
task of creating a simple extension. A link to the Extensions API
is also presented.
A Harsh BlueJ?
The previous BlueJ article generated lots of feedback regarding
BlueJ inadequacies. I have decided to conclude this series by
responding to some of that feedback.
How does learning to use BlueJ help the student learn
Java? Although the student might become expert at
interacting with BlueJ, that same student might be lost when having
to work with Java in a command-line-driven environment or when
confronted with another IDE because the student hasn't really
learned Java.
I believe that BlueJ's simplicity helps a student learn Java. In
my experience, students new to Java (or new to computer
programming, in general) have a harder time learning Java in a
command-line-driven environment than in an IDE. Furthermore,
feature-rich IDEs may intimidate beginners. BlueJ's simplicity
helps beginners focus more on Java, without having to devote lots
of time to learning an IDE.
I also believe that BlueJ's visualization and interaction
techniques help a student learn Java. BlueJ's class diagram
provides students with the big picture: they quickly see how all
(or most, assuming the presence of user libraries) of the pieces of
a Java project fit together. They can then drill down into the
source code, for study or modification, by double-clicking the
appropriate icon. Furthermore, the code pad can help the student
master the syntax and semantics of Java expressions and
statements.
In a multi-year or a multi-semester course, BlueJ would nicely
fit into the first year or semester. After that, the instructor
could introduce students to Java's command-line tools, where the
student would develop a better understanding of packages and
classpath. Moving forward, the student could be introduced to a
powerful IDE, such as Eclipse or NetBeans (assuming the teaching
institution can afford the IDE), preparing that student for the
workforce.
Class diagrams are inadequate (only two relationships
can be expressed). Furthermore, the object bench does not show
relationships between objects. BlueJ's visualization tools
should take advantage of Unified Modelling Language (UML), rather
than pretend to be UML.
How does one properly structure a course without overloading the
beginner student? Should the beginner be given a complete UML
treatment from day one (and be required to learn many diagram
types), or should the beginner be gently introduced to UML through
limited exposure? BlueJ limits exposure to UML by providing a
UML-like experience without wading deeply into UML. In a multi-year
or multi-semester course, it might be more effective to fully
immerse the student in UML after the first year/semester.
Note: Regarding BlueJ's object bench, I encountered an
interesting article suggesting that Microsoft has copied this BlueJ
feature into its Visual Studio product, "Microsoft Goes BlueJ" (see
Resources). I also discovered a response
to that article in a blog.
Conclusion
BlueJ provides quite a few features, such as debugging,
documentation, executable JAR files, code pad, and unit testing,
beyond those features explored in the previous article.
Although you can use the built-in debugger to locate bugs that
are discovered during unit testing, you cannot automatically employ
unit testing: you must first configure BlueJ to activate that
feature.
In addition to configuring BlueJ (from user and administrator
contexts) to somewhat change BlueJ's behavior, you can extend BlueJ
to introduce new features that increase its usefulness.
BlueJ's included submitter extension allows students to submit
their work to course tutors.
My previous BlueJ article generated feedback that took issue
with BlueJ. I hope you found my responses to some of that feedback
enlightening.
I have some homework for you to accomplish:
- For space reasons, I was unable to dig into BlueJ's support for
applets. Therefore, your new homework is to investigate BlueJ's
applet support and answer the following questions: how do you
create an applet in BlueJ, and can you set breakpoints in the
applet?
Next time, Java Tech focuses on the generics language
feature.
Resources
Answers to Previous Homework
The previous
Java Tech article presented you with some challenging homework
on BlueJ. Let's revisit that homework and investigate
solutions.
- Use BlueJ to add a
FactoryWorker class that
subclasses Employee. Factory workers receive a payment
based on a fixed amount per item they create. For example, a worker
receives five dollars for each created item. If the worker creates
100 items in a week, the worker's payment is 500 dollars. Extend
RunPayroll to include FactoryWorker.
Consult the FactoryWorker.java and
RunPayroll.java source codes in this article's
attached code file (see Resources).
Jeff Friesen is a freelance software developer and educator specializing in Java technology. Check out his site at
javajeff.mb.ca.