BlueJ Frequently Asked Questions


BlueJ Features How do I call a main method in BlueJ, and how do I pass it arguments?

You can call a main method in the same way as you call any static method in Java - by right-clicking on the class in the class diagram, and selecting the method from the pop-up menu.

When you call the main method from a class, you will see a parameter entry field that prompts you for the array of strings that the main method takes as a parameter.

By default, the parameter is

{ }

(an empty array, no parameters). If you want to pass, say, three parameters, from a command line you would write

java MyClass one two three

In BlueJ, you use the following parameter for "main" in the dialog text field:

{ "one", "two", "three" }

This passes an array of the three strings, just as the command shell does.

How do I clear the terminal?

There are two different ways to clear the terminal in BlueJ. You can get BlueJ to automatically clear the terminal before every interactive method call. To do this, activate the 'Clear screen at method call' option in the 'Options' menu of the terminal. You can also clear the terminal programmatically from within your program. Printing a formfeed character (unicode 000C) clears the BlueJ terminal, for example: System.out.print('\u000C');

This will work in the BlueJ terminal, but is not guaranteed to have the same effect in all terminals.

How do I use custom class libraries (JARs)?

Sometimes, you may want to make your own libraries generally available in the same style as the Java standard libraries. For example, you may have your own package called "simpleIO" that you want to use. Then you may want to be able to write import simpleIO.*; without the need to copy all the simpleIO classes into every project.

There are actually three ways of doing this in BlueJ.

The first way is via the "Preferences" dialog. Open the "Preferences" dialogue and select the "Libraries" tab. Then add the location where your classes are as a library path. Restart BlueJ - done. The selected libraries will now be available in all projects that you open.

One small thing to look out for: if the classes are in a jar file, select the jar file itself as the library. If your classes are in a named package directory structure (for example in a directory named "simpleIO"), choose the directory that contains simpleIO (not the simpleIO directory itself) as the library!

The second way is via the "userlib" directory, found at <bluej-dir>/lib/userlib (that is, inside the "lib" folder which is itself found inside the folder in which BlueJ was installed). Any libraries placed in this directory will be loaded by BlueJ. This is intended to be a "system wide" method to use custom class libraries as it will apply to all users using the same installed copy of BlueJ, so it can be used for instance in a lab environment to make the libraries available to all students. These libraries must be .zip or .jar archives.

Naturally, to put a library in a "userlib" directory, a person must have write access to the directory.

Libraries loaded via this second method are listed in the "Libraries" tab of the "Preferences" dialog also, but libraries cannot be added to or removed from the userlib directory via the dialog. These libraries will be available in all projects.

The third way is via the "+libs" directory. If a directory called "+libs" is found inside a project when it is opened by BlueJ, then all the class libraries inside it will be on the classpath (and therefore available for use in the project). This is a convenient way to allow libraries to be loaded on a project-by-project basis. This comes in handy if you want to distribute a project with any libraries that might be needed for it to function. You can simply zip up the project directory and distribute the project.

So in summary there are three ways that custom class libraries can be made available inside BlueJ. For system level access (all users and all projects) you can use the "userlib" directory. For user level access (all projects for a single user) you can use the Preferences Dialogue to add a library, and for accessibility from a single project you can create or add an archive to a project's "+libs" directory.

How do I use objects from the standard library classes?

It can be very useful for educational or testing purposes to instantiate library classes. For example: Do you want to play around with a String object? Do you want to see how java.awt.Point behaves? In BlueJ, you can do this.

Select "Use Library Class..." from the tools menu. Then type in (or select from the popup menu) the full class name of the class you want to instantiate. Hit enter, and you will see a list of all constructors and static methods. Select one - and you're done!

You can, in the same way, call static methods of library classes. For example, select java.lang.Math, double-click the "random()" method and - voila - you got a random number!

How do I use JavaFX in BlueJ?

For technical reasons, subclassing the Application class (the usual way to run JavaFX applications) does not work in BlueJ. The best way to write FX code in BlueJ is to have a method like the following:

public void launchFX()
    // Initialises JavaFX:
    new JFXPanel();
    // Makes sure JavaFX doesn't exit when first window is closed:
    // Runs initialisation on the JavaFX thread:
    Platform.runLater(() -> initialiseGUI());

public void initialiseGUI()
    Stage stage = new Stage();
    // ... more initialisation of the Stage

The launchFX() method ensures that JavaFX is initialised and then calls the initialiseGUI() method to actually set up the GUI. The initialiseGUI() method above is just an example of creating a new window and showing it; you will want to customise it with your GUI initialisation. When you want to run the program, run the launchFX() method, which can be called repeatedly without resetting the BlueJ VM.

Installation and Configuration General "BlueJ could not find any Java systems. A JDK must be installed to run BlueJ."
Before it can run, BlueJ requires that a Java development kit (JDK) is installed on your system. If you get this message, then no Java system was found. You should install the appropriate JDK by: Make sure to get the JDK (not just the JRE). Avoid JDK "bundles" (JDK with Java EE, or with Netbeans).
How do I change BlueJ's interface into another language (e.g. German)?
In the latest version of BlueJ, you can choose your interface language by going to the "Tools" menu, selecting "Preferences...", then going to the "Interface" tab and choosing from a drop-down list. If you want to set it per-installation (e.g. for a university-wide installation), you can do so by editing the "bluej.defs". This can be found in the "lib" subdirectory of the BlueJ installation (or elsewhere on Mac OS X). Find the "bluej.language" line (or add one) and change it to (for example): bluej.language=german Next time you start BlueJ, the language should have changed.
How do I make a new translation for BlueJ?

For other languages, you will have to make your own translation. All labels, menus and dialogues have to be translated. We are looking for volunteers to do that. Here is how.

In the lib directory, you will find subdirectories named "english", "german" and "swedish" and so on. These contain all the language dependent texts. Create a new directory for the language you want. Let's say you want to make a language setting for Elvish. In that case, make a directory named "elvish". Then copy all the files out of one of the other language directories into your new language directory. They are all text files. Edit each of those files and translate all the texts in them to Elvish (keeping the format of the files as it is). Once you have done that, you can switch the Elvish language setting on as described above, using the property setting: bluej.language=elvish If you do this, we would be very grateful if you would send us your language files for inclusion into the BlueJ distribution. Someone out there might just be looking for a translation into your language, too.

How do I use a local copy of the Java API documentation?
BlueJ has a menu item named "Java Class Libraries..." in the Help menu. Selecting this function opens a web browser and displays the API for the standard Java classes. By default, the web address points to the Java web site, where the online version of this documentation lives. Installing a local copy of the documentation will allow you to browse the documentation while you are offline. To use a local copy of the documentation do the following:
  1. Download the official documentation in HTML format. You can currently find the download as a zip file on the Oracle website. Unzip it onto a disk on your machine or a local network.
  2. In BlueJ, select "Preferences..." from the Tools menu. You will see a field labelled "JDK documentation URL". Here, you need to put the URL of your local copy of the documentation. The easiest way to do this is to start your web browser, open the local documentation (by choosing "Open File...") and then copy and paste the URL from the browser into the BlueJ preferences field.
Where does BlueJ store its settings?

BlueJ has two files in which in stores its configuration properties.

  • The "bluej.defs" file is installed with BlueJ, and applies to all users who use that installation of BlueJ. On Windows and Linux it is stored in the "lib" subdirectory of wherever you installed BlueJ. (On Mac OS X, it is found in the application bundle.) Usually, you will not want to edit bluej.defs unless you are a system administrator configuring an installation for many users.
  • The "" file is a per-user configuration file stored in a different place on different systems:
    • On Windows Vista, 7, 8: C:\Users\your-user-name\bluej\
    • On Windows XP: C:\Documents and Settings\your-user-name\bluej\
    • On Mac OS X: /User/your-user-name/Library/Preferences/org.bluej/
      For OS X 10.7 (Lion) and newer, please see this page for how to access your Library folder (which is otherwise hidden).
    • On Linux and similar systems: your-home-directory/.bluej/
      Note that ".bluej" is normally an invisible directory.

Properties set in override those in bluej.defs.

You can edit both of these files using a standard text editor.

On Windows you can use the Notepad application to edit the files, but you will need to select "All files" as the file type in the "Open file" dialog. Furthermore, you may need to save the file to a different location (using "save as") and then copy it over the original file using the Windows Explorer if you are unable to save over the original file directly.

How can I pass arguments to the Java Virtual Machine which BlueJ runs on?

BlueJ actually runs two Java VMs: One is for BlueJ itself, and the other runs user code (for instance if you instantiate a class the resulting object is created in the user VM).

To specify arguments for the user VM, use the bluej.vm.args property in bluej.defs (see where BlueJ stores its configuraiton).

To specify VM arguments for the primary VM, you need to do something different according to the operating system you are using:

  • Windows: use the property in bluej.defs
  • Linux/Unix/equivalent: edit the "bluej" shell script which is created by the installer (in the directory where you installed BlueJ), and modify the last line (which launches BlueJ).
  • Mac OS: Control-click the BlueJ icon, and choose "show package contents" from the popup menu; then, double-click the Contents folder, and then the Info.plist file (which should cause the properties editor to open). Expand the "Root" tree and then the "Java" tree, and the "Properties" tree appears below. You can then add new property name/value pairs (equivalent to the command-line argument "-Dname=value") to the "Properties" tree. You can also create a new key "VMOptions" as a child of the "Java" tree, and specify additional command-line arguments as its value. Before you can do this you need to have the Apple Developer Tools installed - the Property List Editor is part of the developer tools; you can find them on the Mac OS installation disc.

Be warned that changing the Java VM arguments is generally unnecessary and if done improperly can prevent BlueJ from functioning correctly.

How can I specify the file encoding that BlueJ uses?

Since BlueJ 3.0.5, encoding is maintained per-project and defaults to UTF-8 for new projects. The encoding is specified in the 'project.charset' setting of the package.bluej file (in the project root).

For older versions of BlueJ (before 3.0.5):

You need to change the "file.encoding" property to a support character encoding name ("UTF-8" or "ISO-8859-1" for example - a list of character set names is available here, though java does not support them all).

You can do this by passing -Dfile.encoding=UTF-8 (for example) as an argument to the Java Virtual Machine. See the FAQ question above for how to do this. You should probably specify the same encoding on both the main and the user VM.

My firewall is causing problems with BlueJ - how do I need to configure it?

BlueJ uses TCP/IP socket communication as part of its normal operation. The communication occurs between two processes running on your computer - one is for BlueJ itself, and the other is for a "debug VM" which runs your program. Although this communication doesn't go over the network, some firewall software will block this communication which inhibits BlueJ operation. (On Windows, recent BlueJ versions instead use a communication method called "shared memory", however, BlueJ will fall back to using TCP/IP if shared memory fails for some reason.)

Firewalls generally take one of two approaches to blocking network traffic. The first approach is to block traffic based solely on the source/destination IP address (and/or port number). The second approach is to block traffic on a per-program basis. A common combination approach is to allow setting specific source/destination rules on a per-program basis. Some firewalls only block incoming connection attempts while other firewalls may also block outbound connections.

For BlueJ to work, communication must be allowed when both the source and destination IP address is, which is the "loopback" address (i.e. it refers to the local machine, not a machine on the network). Note that BlueJ must be allowed to make outbound connections (or "act as a client") as well as receive incoming connections (or "act as a server").

On Windows:

If your firewall sets rules on a per-program basis, the program you should apply the rules to will usually be the bluej launcher (bluej.exe) - however you may also need to specify rules for the Java executable ("java.exe") as well or instead. There are actually multiple copies of the java.exe executable installed as part of the JDK or J2SDK on Windows - you may need to change the rules for them independently. You may also need to change the rules for the "javaw.exe" files.

If you use the standard Windows firewall, you can use the following pages to help you configure the firewall:

If you use 3rd party security software, you will need to consult the documentation for that software.

On Linux:

On Linux, the firewall will normally be configured correctly, unless you are using custom firewall rules. However, Security Enhanced Linux (SELinux) can also prevent TCP/IP communication which will prevent BlueJ from functioning correctly. You should consult your distribution's documentation to determine how to disable or correctly configure both the firewall and SELinux (or, try doing a web search or consulting an appropriate user forum).

Recent Debian systems change the kernel's default network settings in a way which Java doesn't seem to like. You may be able to overcome this by editing the file "/etc/sysctl.d/bindv6only.conf" and changing the setting "net.ipv6.bindv6only" from 1 to 0, and restarting your system.

Some information on why you are seeing the error might be found in BlueJ's debug log, which you can normally see by typing:

cat ~/.bluej/bluej-debuglog.txt

... in a terminal window.

Other Systems:

You will need to consult your system documentation or 3rd-party software documentation for information on how to configure your firewall software.

How do I use a screen reader with BlueJ?

Since Java 7u6, the Java accessibility tools are included with Java as standard -- but they are disabled by default.

To enable the Java accessibility tools, follow these instructions. You may need to restart your machine afterwards. With the Java Access Bridge enabled, BlueJ should work with your installed screen reader (it was tested with NVDA).

Screen reader support was significantly improved in version 3.1.0 of BlueJ (and improved again in version 3.1.1), so we recommend upgrading to at least version 3.1.1.

Does BlueJ have a "dark theme"?

BlueJ does not have a dark theme as such, but you can change many of the colours that it uses in order to reduce visual brightness.

For the editor, you can edit the file "moe.defs" (found within the "lib" folder within the BlueJ installation path) and change the colours there. The important ones are "background" and "other" ("other" controls the colour of plain text). They are specified as hexadecimal red-green-blue triplets. The default values are:

  • background = ffffff (which is white)
  • other = 000000 (which is black)

If you swap these, you have a somewhat usable "dark theme" for the editor already. This will not affect the rest of the interface, however. There is presently no way to change the colours that BlueJ uses for certain parts of the interface, such as the package diagram.

Linux/Unix Installer failed to open: No space left on device
During the installation process, BlueJ needs to write some files. It attempts to write those to the /tmp directory. The error most likely indicates, that you do not have write permission to the system's tmp directory. If this is the case, you can start java and tell it to use a different directory for temporary files: java -jar bluej-200.jar Another possibility is that you are out of disk space altogether. Worth checking as well.
Windows How do I perform a "silent installation" on Windows?
If you are a system administrator you may wish to perform a scripted or "silent" installation of BlueJ. You can use the standard Windows MSI installation tools with the new MSI installer. For example to install BlueJ with all the default settings but without the GUI, you can use: msiexec /qn /L* logfile.txt /i bluej-311.msi (The "/qn" turns off the GUI, the "/L* logfile.txt" logs to a file so you can check if the install succeeded afterwards - look at the end of the file - and the "/i bluej-311.msi" tells it which installer to install from.) If you want to customise the settings, then here's the full set of properties that you might want to tweak for a 32-bit install: msiexec /qn /L* logfile.txt /i bluej-311.msi ALLUSERS=0 INSTALLDIR="C:\Program Files\BlueJ" INSTALLASSOCIATIONS=1 INSTALLMENUSHORTCUT=1 INSTALLDESKTOPSHORTCUT=1 You can leave off any that you don't want to alter from the default setting. The properties are independent of each other, and can be added or removed individually; specify "" (an empty pair of double-quotes) as the property value in order to turn a setting off.
While installing BlueJ on Windows, I get an error: "Installation Directory Must be on a Local Hard Drive"

This is not a BlueJ-specific issue, but a problem with Windows Installer mechanism, which maybe fixed by one of the following ways:

  • Force the launcher installer to run with administrator privileges:
    1. Locate (using Windows Explorer) the BlueJ installer file (.msi) that you downloaded.
    2. While holding down the Shift key on the keyboard, right-click on the BlueJ installer (.msi), then choose "Copy As Path".
    3. Go to Start > All Programs > Accessories.
    4. Right-click on "Command Prompt" and choose "Run As Administrator". This should open a command prompt window, labeled "Administrator:".
    5. In the Command Prompt window, type msiexec /i  (you need to enter a single space after "/i". Do not press Enter!).
    6. Right-click in the Command Prompt window, then choose "Paste". This should paste the path to the MSI file that you copied in Step 2 above.
    7. Press Enter to run the command.
  • If this does not work, please clear your temporary files ("%temp%") folder, then run the BlueJ launcher MSI again, but please notice that applications from other sources can be adversely affected if you manually delete the contents of the Temp folder. Use caution if you choose to do this. We cannot provide support for problems that you encounter from manually deleting files in the Temp folder. Do the following if you wish to proceed:
    1. Close all applications.
    2. Choose Start > All Programs > Accessories. Right-click "Command Prompt" and choose "Run As Administrator".
    3. In the Command Prompt window, type the following command exactly as it appears below, and then press Enter: del %temp%\*.* /s /q Note: "del" is the command that deletes files. "%temp%\*.*" combines the environment variable for the Temp folder location with wildcard characters that specify all files. "/s" extends this to all subfolders. "/q" prevents prompts from occurring for confirmation of each deletion.
    4. You will see a list of deleted files in the Command Prompt window. You may see some files cannot be deleted with "Access is denied" errors or similar. That is normal behavior.
    5. Close the command prompt window
    6. Now attempt to open the BlueJ installer (.msi) and run again.
  • Alternatively, you can install BlueJ without using the Windows installer, by installing the Oracle JDK and then using the BlueJ generic installer, both can be downloaded from "Other Operating Systems" section on the main page.
Other errors when installing BlueJ on Windows

Various strange problems may occur when installing BlueJ on Windows; mostly, these problems are due to issues with the Windows installer framework rather than with BlueJ. Some examples:

  • BlueJ installs but it is not shown in the start menu, on the desktop or in the list of installed programs
  • Error message: "The process cannot access the file because another process has locked a portion of the file"
  • Error message: "The specified account already exists"

Using the CCleaner tool has been reported to solve some issues (this tool is published by a third party and the BlueJ team can not take responsibility for any problems its use may cause nor provide support for this tool).

To diagnose these problems, you should install BlueJ with Windows Installer logging enabled:

  • First, if BlueJ did install (but the installation seems to be broken or incomplete) you should uninstall it.
  • Next, enable Windows Installer logging as per this knowledge base article from Microsoft (enable logging of all messages except for "verbose" messages).
  • Once you've enabled logging, run the BlueJ installation process (again).
  • Locate the log file that was produced (see the knowledge base article) and move it somewhere so that you can find it again easily later.
  • Disable Windows Installer logging (as per the knowledge base article).

You can now try to read the log file yourself, or send it to the support team. To do the latter, use the support request form, and then send the log as an email attachment when you receive a response from a team member. Do not attempt to attach a Windows Installer log when initially submitting the form, as it is only designed to accept BlueJ debug logs.

Mac OS X How do I edit bluej.defs on Mac?
It is rare that you need to edit the application-wide bluej.defs file, but should you need to, you will find it on Mac in a 'Java' directory deep inside the BlueJ application bundle. To find it, Ctrl-click the BlueJ application and select 'Show Package Contents'. Then navigate your way down the folders Contents/Resources/Java. Here, you will see the file 'bluej.defs' (and all other BlueJ configuration files and directories). You can edit the bluej.defs file using a standard text editor (like TextEdit).

How do I know if I have the correct Java version for BlueJ on MacOS X?

Recent versions of BlueJ (3.1.0+) are bundled with the JDK. These versions require Mac OS X 10.7.3 or later, and do not require the JDK to be installed separately. It is also possible to use the 'legacy' package which uses the system JDK, on systems where JDK 6 is installed (keep reading for more information).

BlueJ versions 3.0 - 3.0.9 require Java 6 and previous versions (2.5.0+) require at least Java 5.

On Mac OS X 10.4 (Tiger), only Java 5 is available. On Mac OS X 10.5 (Leopard), Java 6 is available with an update (10.5.2) but only on 64-bit Intel processor systems (not on systems with a PowerPC, Intel Core or Intel Core Duo processor).

What this means is: you will not be able to run BlueJ 3.0 - 3.0.9 on a Mac with OS X 10.4 (Tiger), nor on some Macs with OS X 10.5 (Leopard). You can however run BlueJ 2.5.3 on these systems.

Regardless of which OS X version you have:

You must make sure that the correct Java version is active in order to run BlueJ. To do this, run the "Java Preferences" application (Tiger: Applications / Utilities / Java / J2SE 5.0 / Java Preferences; Leopard/Snow Leopard: Applications / Utilities / Java Preferences), choose the "General" tab, and move Java SE 6 (or Java SE 5 if you do not have Java SE 6) to the top of the list. If you do not see Java SE 6 in the list, you will not be able to run BlueJ 3.0+.

Problems using BlueJ General What should I do about this error: "Bluej was unable to create a virtual machine (VM) to execute projects".

As the full message text states, this problem is normally caused by firewall software interfering with BlueJ's operation. More information on how to deal with this issue is available here.

Another possible cause of this problem is that characters in the path to your project (including the project name) are not representable in the system character set. This often occurs when you use accented characters (or non-English characters) in your project path, and is actually due to a Java bug. In this case the easiest solution is to rename/move your projects to a location without the troublesome characters.

If you cannot resolve the problem, you will need to contact the BlueJ support team.

The New Class and Compile buttons are greyed out
You need to open a project, or create a new project, before you can create classes and compile them. Use the "Open Project..." or "New Project..." command from the Project menu.
I cannot create objects or inspect classes
You may right click a class and the only options are "Open Editor", "Compile", "Inspect" (which is greyed out) and "Remove". This problem is easily solved - the class simply needs to be compiled. The best way to do this is to use the "Compile" button which appears at the left hand side of the BlueJ window - this will compile all classes which are presently uncompiled. Alternatively the "Compile" option available in a Class's popup menu can be used to compile that class by itself. Once a class is compiled, the grey diagonal stripes across the class will disappear and the missing options will become available.
I wrote a program that asks for input (using Scanner class,,* classes). When I run it, it does nothing, and just keeps running forever!

If your program requests input, then you must supply the input before the program can continue running! What is happening is that your program is waiting (indefinitely) for the input that it has asked for.

Generally, you can open the terminal from the 'view' menu and then type into it. Press 'enter' after supplying the input (the terminal input is line buffered).

As a better solution, you should have your program output a prompt (eg. "Please enter your name") before trying to read input. That will cause the terminal window to open automatically.

Windows On Windows, using Java 6, the splash screen shows, but the BlueJ window doesn't appear

There is a Java bug which can cause this problem. If this bug is affecting you, the BlueJ debug log will contain a stack trace with (at some point) a message something like:

Caused by: java.lang.IllegalArgumentException: 181193932 incompatible with Text- specific LCD contrast key
at java.awt.RenderingHints.put(

This bug should be fixed in Java 7, so upgrading to Java 7 is the obvious. fix. It is also possible to resolve this problem by running "Cleartype Tuner" as described in this blog post.

What should I do about this error: "Couldn't find the bluej.Boot class"

The most common cause of this problem is that only an old JDK (Java 5 JDK) is installed. You need the Java 6 or Java 7 JDK to run BlueJ.

You can download the JDK here:

Then, use the "select VM" utility (from the start menu) to choose the newer JDK for BlueJ.

On Windows, BlueJ asks for the JDK location on every startup - how can I fix this?

The situation is usually this: on a multi-user installation, the system administrator installs and starts BlueJ, including the selection of the Java version (JDK/J2SDK). BlueJ runs fine. But when other users start BlueJ, they are prompted every time for the JDK location.

The reason are write restrictions to the Windows registry. On Windows, BlueJ remembers the selected JDK version by writing an entry into the user space of the registry. If the registry is write protected, or if it is restored to its original state on every login, this information is lost, and the user will be asked again.

There are two solutions available.

The first is to give users write access to the Windows registry.

If this is not practical (for example in some lab environments) then BlueJ can be explicitly configured to use a specific JDK, using a property in bluej.defs (see Tip 4 in the tips archive for general info about configuring BlueJ).

Set the '' property in bluej.defs to the path of the JDK you want to use. This property is commented out by default. If it is set, BlueJ will not check the registry, not ask the user, but just use this Java version and start.

There are visual artifacts on the BlueJ windows (black areas, distorted text, etc) in Windows

Visual artifacts - black areas, distorted or missing text, etc - are usually a result of either a display driver bug or a Java bug. Try updating your display drivers (see here for Windows 7) or disabling graphics acceleration (see here).

If you are running a version of BlueJ which does not bundle the JDK, you should also make sure your JDK is up-to-date. Remember to run the "select VM" utility to ensure that BlueJ runs with your most recent Java version.

We have had some reports of text disappearing when the mouse cursor hovers over it, especially with Intel Graphics 4000 HD chipsets; the drivers may be buggy. A solution in this case is to disable Java's use of Direct3D (D3D) for rendering. To do this, you need to edit the BlueJ configuration (the bluej.defs file) and change (or add) the setting by adding -Dsun.java2d.d3d=false. For example, change:


(Make certain to remove the '#' at the beginning of the line!) It's possible that this setting will help with similar problems on other graphics chipset too.

On my Windows laptop, BlueJ runs unbearably slowly if I disconnect the AC power (i.e. if I am running using battery power)

This is a problem which affects some laptops. It may be due to video driver problems, so it's worth trying to update your video drivers if possible.

The problem affects Java applications other than BlueJ and there is a bug in Oracle's bug database regarding the issue.

The suggested fix is to edit the bluej.defs configuration file and enter the following settings:


Mac OS X I cannot open projects from a USB storage device

The "open project" dialog in BlueJ, because it comes from Java, is different from file chooser dialogs in native Mac applications. It doesn't show a list of devices (such as USB sticks) which makes it harder to locate them.

You can open projects from such a device by going in to the "Volumes" folder in the top-level "Macintosh HD". Mounted volumes from storage devices will be listed there.

Execution fails on Mac OS X when connected to a network

On Mac OS X 10.2 and later, execution in BlueJ can fail when several Macintoshes on the same network have the same computer name (set in System Preferences/Sharing).

Solution: ensure that different machines have different names.

I am using Mac OS X, and I cannot create objects

If you are on Mac OS X, and you try to create an object and it never finishes (the message "Creating object..." stays in the status bar), the reason may be the use of a proxy server for network access.

BlueJ uses sockets for communicating between two local virtual machines, and this is affected by the system's network settings. If your organisation uses a proxy, this may be the cause.

The solution: configure localhost traffic not to use the proxy server.

Here is how:

In recent versions of OS X, including Snow Leopard, open your System Preferences, go to the Network panel, click Advanced... and select the Proxies tab. Add "localhost" (without the quotes) to the Bypass proxy settings box.

On older versions of OS X, open your System Preferences, go to the Network panel, click Configure and Proxies for your network connection. Add "localhost" (without the quotes) to the Bypass Proxy Settings box.

On Mac OSX, the "BlueJ" menu is non-functional (and the other menus don't appear)

There appears to be a bug in Apple's Java (Mac OS X 10.6.2, Java 1.6.0_17) which prevents BlueJ's menus from working when certain languages are selected as the preferred language via the system preferences.

One workaround is to set English as the preferred language.

Another workaround is to set BlueJ to use the "cross platform" look-and-feel rather than the "Aqua" (Mac OS X native) look-and-feel. To do this, edit the "bluej.defs" file (see tip of the week #12) and remove the '#' at the beginning of the line which reads:


So that it reads:


This will make BlueJ use the (uglier) "cross platform" look-and-feel, but at least the menus (which will appear at the top of the BlueJ window) will be functional.

Linux Error: "BlueJ was unable to create a virtual machine (VM) to execute projects..."

On Linux, this problem can be caused by Security Enhanced Linux ("SELinux") or overly restrictive firewall rules. Consult your distribution's documentation to find out to disable or correctly configure SELinux and/or the firewall. More information is available in the earlier firewall answer.

If you are running Debian "Sid" (the "unstable" Debian release) and you get this error message, it may be because of an apparent incompatibility or bug with Java. Some users have been able to resolve this by editing the file "/etc/sysctl.d/bindv6only.conf" and changing the setting "net.ipv6.bindv6only" from 1 to 0, and restarting the computer. However, we recommend that you do not run the unstable Debian release (or any other "unstable" Linux distribution or operating system) if you are not able to resolve problems like these on your own.

Raspberry Pi Error: "Hardware access not available in this account because the user is not in the sudoers file"

On the Raspberry Pi, the user needs super user permissions (without password) in order to access hardware. Whenever BlueJ can't acquire such permissions, it will run with hardware access disabled.

This problem can be caused when a user does not have access to root. To give root access to your user account, you need to use an account with sudo access to edit the file "/etc/sudoers" using the command "sudo visudo". Then add "john ALL=(ALL) NOPASSWD: ALL". Where "john" is the user account you want to give sudo rights.

To re-enable hardware access in BlueJ, go to the menu Tools, select Preferences and open the Rasbperry Pi tab, then select the option Allow access to GPIOs (requires sudo), close BlueJ, log out of your user account and then log back in (or do a reboot). Now BlueJ will run with hardware access.