CNU BlueJ Formatter Logo

What is CNU BlueJ Formatter?

  • Download CNU BlueJ Formatter
  • Version 1.0.2, All Platforms, English (5.4MB)
    Requirements: BlueJ 3.0.8 (only) & Java 1.5 (or up)

    It is a configurable extension to BlueJ that allows the automatic formatting of Java source code. The formatter adds a "Format" button to the editor, which you can use to format your code.

    The formatter follows style properties that you can customize to a style suiting your needs.

    How to install

    Download and execute the installation file, which is an executable JAR file.

    During installation, you must identify the folder where BlueJ is installed and then press the "Install" button to install the formatter. You can use this program to uninstall the formatter, if you no longer need it.

    The formatter requires that both BlueJ and Java are already installed in your computer (see Requirements below).


    There are versions of the formatter for BlueJ versions 2.2.1 and 2.5 (only) under Java 1.5 (or later).

    The restriction on BlueJ versions is due to the fact that we provide a modified version of BlueJ's editor, which has an interface that is not always compatible across versions. We are planning to release versions of the formatter that go along with future releases of BlueJ.

    How does the formatter work?

    From a user's perspective, the formatting functionality is accessed though a "Format" button in BlueJ's editor. This functionality can be customized by modifying the formatter's style properties. To this end, we provide a simple properties editor, which is a BlueJ extension that can be accessed through the Preferences dialog.

    From a system's perspective, the formatting functionality is provided by classes that were implemented in Eclipse 3.2 (Europa). We decoupled this functionality and integrated it into BlueJ's editor. As a result, the formatter is released under the terms of Eclipse's Public Licence Agreement and BlueJ's Open Source License.

    Why did you develop the formatter?

    At CNU, we teach our CS1 course using BlueJ and Web-CAT, which is a web-based system for submission and grading of programming assignments. One of Web-CAT's strengths is that of checking source code compliance to a formatting style. While we wanted to take advantage of this feature, we also wanted to adopt it in the least intrusive way possible--that is, we want novice programmers to be aware that code formatting is desirable, but we don't want them to take their attention away from the main goal of learning programming.

    Rather than implementing our own code formatting functionality, we decided to reuse Eclipse's (as a side note, since we use Eclipse in our CS2 courses, we pondered whether to adopt Eclipse earlier in CS1 but we deemed that it can be intimidating to non-major students new to programming). As a result, we isolated Eclipse's implementation and port it into BlueJ.

    Who developed the formatter?

    Interestingly, the implementation of the formatter was the result of a Software Engineering course project in which a small group of graduate students coordinated the efforts of undergraduate student teams. The project priorities were: to identify Eclipse's formatting functionality and isolate its class dependencies, integrate identified Eclipse classes into Moe (BlueJ's editor), provide an installer that would merge the formatter with an existing BlueJ installation, and develop a prototype BlueJ extension to edit the formatting style properties. The formatter is the result of this effort.


    Please email any questions and comments to


    Version 0: P.Ballard, E.Beatley, J.Chunta, P.Dubinski, D.Goodwin, T.Hellmann, B.Jump, P.Kukura, G.Lauderdale, R.Lowry, C.Miller, Q.Mirick, C.Murphy, M.Press, R.Rodriguez, T.Schalkham, E.Semelsberger, A.Tenezaca, B.Thal, S.Whitaker, P.Biron, Z.Corbet, W.Jowitt, P.Krentz, C.Linke, M.Mahair, J.Schultz, S.Smith, D.Wilder.
    Version 1.0.2: M.Saddem.

    External sites

    Christopher Newport University | Department of Physics, Computer Science & Engineering