BlueJ Frequently Asked Questions


Contents


General questions Do you have a privacy policy?

The BlueJ team does not have a privacy policy, because we do not collect any personal information.

BlueJ does collect some non-personal or anonymous information, first, as detailed in the README file:

When you use BlueJ, some anonymous non-personal information (BlueJ version, Java version, Operating System, interface language, etc) is sent to the BlueJ maintainers, to help with development planning. This can be disabled by adding a "bluej.uid=private" setting to your bluej.properties file.

Second, when BlueJ is first started it presents the user to opt-in to a more involved data collection. The user may elect not to opt-in, but even if they do opt-in BlueJ does not collect personal information. A full explanation of what data is collected and answers to related questions can be found in the Blackbox FAQ.

What are the terms of use?

There are no terms of use, except that you must obey the license requirements for redistribution. Specifically, BlueJ is distributed under the GPLv2 with Classpath Exception.

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?

BlueJ 4.0.0 and later versions have support for running JavaFX applications. If you have a subclass of JavaFX's Application class, you can right-click on it and select "Run as JavaFX application". Since version 4.1.1, BlueJ will also prompt you to ask if you always want to run this project's code on the JavaFX thread, which is required if you want to interactively invoke code that manipulates the JavaFX GUI.

If you want to run JavaFX code without writing your own Application subclass (or you are using BlueJ 3), you must initialise JavaFX in your code (e.g. by creating a new JFXPanel) and use Platform.runLater to wrap any JavaFX-related code.

Why is the option to create an applet missing?

Support for creating and running applets was removed in BlueJ 4.0 (as noted in the version history). This change is in line with the deprecation of applet technology within the Java runtime environment, as announced by Oracle. Many of the web browsers have also removed support for running applets.

An alternative, for those wishing to create simple GUI-based applications in BlueJ, is to use the JavaFX API. There are various tutorials for JavaFX available on the web — see for example this one at tutorialspoint.com, or use a web search to find others.

If you really need support for applets in BlueJ, your only option is to use an older version of BlueJ (3.1.7 is the last version to support applets).

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).
Can I run BlueJ with Java 9, 10, 11...?

The latest versions of BlueJ (4.2.0+) require Java 11. Most BlueJ installers now ship with the correct version of the JDK included.

Older versions of BlueJ (4.1.4 and earlier) require Java 8.

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 / macOS). 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), then run the "native2ascii" utility that comes with the JDK to convert the files to the correct format. 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. (before version 5.3.0) 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.
  3. (from version 5.3.0) Modify these BlueJ properties (see how here):
    • url.javaStdLib with the path of the documentation (where "index.html" is located).
    • doctool.linkToStandardLib with either true or false, which indicates whether to use the selected path to generate documentation.
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 / macOS, 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 "bluej.properties" 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\bluej.properties
    • On Windows XP: C:\Documents and Settings\your-user-name\bluej\bluej.properties
    • On Mac OS X / macOS: /User/your-user-name/Library/Preferences/org.bluej/bluej.properties
      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/bluej.properties
      Note that ".bluej" is normally an invisible directory.

Properties set in bluej.properties 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 bluej.windows.vm.args 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 X / macOS: 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), and determines both the encoding used by programs run under BlueJ as well as the encoding used for Java source files within the project.

For older versions of BlueJ (before 3.0.5):

You need to change the "file.encoding" property to a supported 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 127.0.0.1, 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.

If you have adjusted or disabled your firewall but BlueJ still does not run, you could try performing a clean boot. If BlueJ runs after a clean boot, you can then determine which service prevents BlueJ from running (see the instructions on the "clean boot" page). You may be able to leave the service disabled, or contact the vendor for support.

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, first copy the file lib/stylesheets/java-colors.css to your BlueJ user directory (e.g. on Windows this is typically C:\Users\your-username\bluej). This copy of the file will take preference, and you can edit the colours there. One important set are the foreground text colours which are specified as -fx-fill in the ".token-XXX" blocks at the top, especially .token-default. The main background colour, and other background colours for scope highlighting, are specified in the .scope-colors block. There is presently no way to change the colours that BlueJ uses for other parts of the interface, such as the package diagram.

Can the fonts used by BlueJ be changed?

BlueJ uses JavaFX for UI rendering. The style of most UI elements in BlueJ can be changed via CSS, a common practice with JavaFX.

The CSS files used by BlueJ for style rendering are located in the lib/stylesheets folder, located into the BlueJ user directory (e.g. on Windows this is typically C:\Users\your-username\bluej).

Where it applies, a font family can be provided to the right class using the CSS property name -fx-font-family. For further details about how CSS is used with JavaFX, refer to the offical documentation (JavaFX 11).

We also advise the use of ScenicView to ease the exploration of the JavaFX objects styling in BlueJ, for example to check the CSS class names.

Can a default location for BlueJ projects be set?

It possible to set a default location for BlueJ projects to be saved to (or opened from).

However, this default location will be overwritten as soon as the user choose a different location in BlueJ.

In order to specify a default location, uncomment and/or change the property bluej.projectPath with the desired location value in the BlueJ settings. (Note that ':' and '\' need to be escaped with '\' in the settings files.)
See how to access the BlueJ settings files.

Linux/Unix Installer failed to open: java.io.IOException: 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 may indicate that you do not have write permission to that directory.

If this is the case, you can start java and tell it to use a different directory for temporary files:

java -Djava.io.tmpdir=/something/something -jar bluej-200.jar

Another possibility is that you are out of disk space altogether.

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, you can try to clear your temporary files ("%temp%") folder, then run the BlueJ launcher MSI again. Please note that other applications can be adversely affected if you manually delete the contents of the temporary files folder; use caution if you choose to do this. We cannot provide support for problems that you encounter from manually deleting files in the temporary files 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 specifying the temporary files folder with wildcard characters that specify "all files". "/s" extends this to all subfolders. "/q" prevents confirmation prompts from being displayed.
    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, which can be downloaded from the "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 / macOS 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 (4.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.

For older versions of BlueJ:

Versions 3.1.x are also bundled with a JDK, however for these versions it is also possible to use the 'legacy' package which uses the system JDK, on systems where Java 6 is installed.

Versions 3.0.x: These versions of BlueJ require Java 6 to be installed separately.

Versions 2.5.x: These versions require Java 5 or 6 to be installed separately.

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, if you use a version of BlueJ which does not bundle the JDK then:

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+.

BlueJ crashes on MacOS Mojave (while dialog is displayed)

We have found that on MacOS Mojave, Greenfoot can crash when a dialog is displayed. This may happen if the "update API" dialog is shown when an old scenario is opened but may also occur for other dialogs, particularly if you switch to another application while the dialog is shown.

This is actually a Java crash, described in bug entries here and here.

A workaround is to add BlueJ to the accessibility list in:

System Preferences > Security & Privacy > Privacy (tab) > Accessibility (in list on left; then add BlueJ to the list of applications on the right).

Doing this appears to prevent the crash.

BlueJ is authorised in a MDM configuration, but it still does not run properly.

BlueJ is itself a Java application, and creates another instance of a Java Virtual Machine (in which the user code written in BlueJ is executed). BlueJ launches these two applications: /Applications/BlueJ.app/Contents/MacOS/JavaAppLauncher and /Applications/BlueJ.app/Contents/JDK/Home/bin/java.

Make sure that the following applications are also granted authorisation in the MDM:

  • Bluej.app and/or org.bluej.Bluej,
  • com.apple.JavaWebStart and com.apple.JavaLauncher.

Some MDM may need extra authorisation for running OpenJDK, which BlueJ uses. To do so, create a "placeholder" package with your MDM with the Bundle ID set to net.java.openjdk.cmd.

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; see also this linux-specific information.

Another possible cause of this problem when running on Windows 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, System.in.read(...), java.io.* 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.

I can't connect to a Git repository on an external host (Github, Gitlab etc)

Since you are using Git over the network, it is affected by firewalls. If you have a proxy which you use for access to web sites via the HTTP/HTTPS protocols, then you should configure BlueJ to be aware of the proxy, which it can then use to access Git repositories on external hosts. This is a little bit complicated, but can be done following the steps below:

First you need to determine the proxy host and port for each protocol. Ask your system administrator for the correct settings. Note that HTTP and HTTPS will typically (but not necessarily) use the same proxy host and port.

To configure BlueJ to use a proxy, you need to define the Java properties http.proxyHost and http.proxyPort (for HTTP). For HTTPS the equivalent properties are https.proxyHost and https.proxyPort. (You might also be able to specify that the system proxy settings are used, by setting java.net.useSystemProxies to true, but we haven't been able to verify if this works).

To define the properties, you must add a -D option for each of these properties to the Java command line when BlueJ starts; for example, you might use:

-Dhttp.proxyHost=myproxy.myschool.edu -Dhttp.proxyPort=8000

These are just examples however - you'll need to use the correct host and port value!

Determine the appropriate command line arguments for your proxy settings. Then, you need to ensure that BlueJ starts with these arguments supplied to Java. To do that, see the explanation in this FAQ entry. (For Windows, you will need to edit the bluej.defs file and set the bluej.windows.vm.args property).

I use my GitHub account password in BlueJ but cannot perform any team actions (unable to authenticate).

GitHub no longer allows GitHub account passwords to be used for version control operations, such as checking out and pushing.

GitHub now has a system called Personal Access Tokens, these "tokens" can informally be seen as sub-passwords. GitHub now view your main password as only for logging in to their website and controlling generation of sub-passwords for individually specified purposes.

You will need to follow the instructions of the above link to generate a "token" for the relevant repository, then enter this token into BlueJ's password field.

Texts in BlueJ look like gibberish.

The work-around this issue is simple: specifying a font family usually solves the problem.

Follow this procedure to change the font family in BlueJ.

Windows I see the BlueJ editor or terminal in the taskbar, but not on screen

This problem can occur especially after connecting and then disconnecting a second monitor or projector display. The window is open, but cannot be seen on screen, because it is located outside of the visible screen area; you need to move it back to the visible area. There are a number of ways to do this described on this page.

(You may also experience this problem if you change your display resolution, or if your project settings have somehow become corrupted).

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

This problem has been known to affect older versions of BlueJ. The most common cause of this problem is that the JDK version is too low, and BlueJ requires a newer version (e.g. some versions of BlueJ require Java 6 and produce this issue when run with Java 5).

You can download the JDK here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html

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

We recommend running the latest version of BlueJ, bundled with a recent Java JDK, to avoid this and other problems. Note that Bluej currently (version 4.x) requires Java 8.

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 is write restrictions to the Windows registry prevent BlueJ from saving the selected JDK. 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 to select the JDK location again.

This problem should not occur on versions of BlueJ which are bundled with a JDK. We recommend using a "bundled JDK" installation package rather than installin BlueJ and the JDK separately. Since BlueJ 4.0.0, only the bundled package is available; BlueJ is no longer available as a separate download.

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 'bluej.windows.vm' 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 bluej.windows.vm.args setting by adding -Dsun.java2d.d3d=false. For example, change:

#bluej.windows.vm.args=

to:

bluej.windows.vm.args=-Dsun.java2d.d3d=false

(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.

BlueJ crashes and asks about sending an error report

Most crashes in BlueJ are related to graphics card issues. See the answer directly above about updating graphics card drivers for likely fixes. Also, if you are running your graphics card overclocked, try running without overclocking, as overclocking is known to cause graphics-related crashes.

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:

bluej.vm.args=-Dsun.java2d.ddoffscreen=false

Why does nothing happens when I double click on an executable JAR created in BlueJ?

When you double click on a Jar application in Windows, it will not open a console window, therefore, if your application outputs text using System.out.println (for example), this output would be invisible.

One possible solution would be to write a GUI interface. Another one would be executing your jar using the command line, running:

java -jar yourApplication.jar

I cannot open a project file located in a path containing non-ASCII (non simple Latin) characters

When double-clicking a BlueJ project file, BlueJ is usually opened and the corresponding project loaded.

However, on Windows, if the path of the project contains some non-ASCII characters (i.e., characters that are not simple Latin), BlueJ shows an error and the project cannot be opened.

This bug is a known Java issue that is therefore not directly related to BlueJ (see this bug ticket for more details).

To overcome this problem, either open the project from BlueJ, via the “Project” menu, or, if possible, save the project in a path that does not contain non-ASCII characters.

Mac OS X / macOS Ctrl-Space does not trigger code completion on Mac

By default in macOS, ctrl-space is assigned to switch input source. There are two ways to fix this. One, using fn-ctrl-space can trigger the BlueJ shortcut instead. Two, you can disable or re-assign the macOS shortcut. Go to the system settings, then select the "Keyboard" section in the left-hand list. Click the "Keyboard shortcuts" button, and in the new window select "Input Sources" on the left. Either untick the box to disable the shortcuts altogether, or double-click an item to assign a new shortcut.

I cannot open projects from a USB storage device

Note: this problem should be resolved in BlueJ 4.0.0+.

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 OS X, 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:

#bluej.lookAndFeel=crossplatform

So that it reads:

bluej.lookAndFeel=crossplatform

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.

The BlueJ splash screen / main window do not appear

Some macOS users are affected by a JDK bug which prevents BlueJ from starting properly. Fortunately there is a simple work-around: open the Font Book application, and choose "Restore standard fonts..." from the File menu (click "Proceed" when prompted).

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, a user needs super-user privileges ("root access") in order to access certain hardware interfaces, including the general-purpose I/O ports. Whenever BlueJ can't acquire such permissions without supplying a password, it will run without access to this hardware, and display the "Hardware access not available" message.

To give root access to your user account, you need to edit (from a privileged account) the file "/etc/sudoers" using the command "sudo visudo", and add the line "john ALL=(ALL) NOPASSWD: ALL" (where "john" is the user account you use to run BlueJ).

To re-enable hardware access in BlueJ, go to the Tools menu, select Preferences and open the Raspberry Pi tab; select the option Allow access to GPIOs (requires sudo), and then close BlueJ. The next time you start BlueJ it will run with full hardware access.