oSCJ is an open-source implementation of a restricted subset of Safety-Critical Java. It is developed at Purdue University and is originating from the JSR-302.

Supported Platforms:

  • x86 running on POSIX-like platforms (succesfully tested on Ubuntu, Fedora and Open SUSE)
  • LEON3 embedded board running RTEMS OS 4.9 (RTEMS 4.10 will be supported as soon as its stable version is released.)

Distribution Highlights

The oSCJ distribution contains: oSCJ Infrastructure

  • SCJ Library -- Library implement Safety-Critical Specification for Java. We focuse on compliance level 0.

  • SCJ Virtual Machine -- SCJ-compliant Virtual Machine is included in the distribution, it is based on OVM

  • Benchmark -- miniCDj benchmark is also included. It is a Collision Detection Benchmark CDx that was implemented in SCJ.

  • Tools -- A set of tools is shipped with oSCJ. It includes TCK and Static Checker.
In the following text we give a short overview of the oSCJ distribution content, for more detail information see the readme file provided with the distribution and the documnetation in doc/.


The oSCJ distribution that we provide has a few limitations:

  • Level 0 support -- We support only a restricted set of SCJ Level 0 features
  • SCJ-VM -- Our VM is based on OVM which supports only Java 1.5 applications with exceptions of annotations. It is recommended to use Java 1.4 version for SCJ applications runned on top of SCJ VM.
  • Interrupts and Happenings -- support for Interrupts is planned, however, its postponed till its clarified by JSR-302.
  • RawMemory Access and I/O are not supported yet. Support of these features is planed to be implemented soon.

Directory Structure

The oSCJ is arranged into several different directories:
  • oSCJ/
    • OpenVM/ -- contains distribution of our SCJ-compliant VM
    • build/ -- the SCJ-OVM configured for will be installed into this directory
      • x86/ -- oSCJ compiled for x86
      • leon3/ -- oSCJ compiled for leon3
    • doc/ -- documentation directory
    • examples/ -- examples of SCJ applications
      • HelloWorld/ -- hello world application
      • minicdj -- the miniCDj benchmark distribution
    • scj/
      • ri/ -- SCJ library implementation
      • ri_rtsj/ -- SCJ library implementation based on RTSJ
    • tools/
      • checker/ -- Static Checker distribution
      • tck/ TCK for SCJ
    • readme
    • LGPL-License.txt



The requirements for running oSCJ on x86 can be summarized as follows:
  • POSIX-like OS -- Tested on Fedora, and SUSE linux.
  • Java 1.5
In addition, to run oSCJ on LEON3/RTESM board, the following requirements must be met:
  • RTEMS OS distribution 4.3.9 --
  • GRMON tools -- see Gaisler for more info

Installation Process

The installation process includes compilation of SCJ and SCJ-VM. You can simply launch it by typing: $ make


To run all testcases in the TCK, a tckrun.sh script is provided in the root directory of the distribution. Again, it assumes that the java in the PATH is a real-time VM.

Hello World

To run the helloworld example distributed with oSCJ, simply type: $ make hello

Running the CDx Benchmark

To run the miniCDj benchmark, type: $ make cdx


You can run also your own application by typing : $ make app APP=directory APP_LAUNCHER=Main
Where APP and APP_LAUNCHER are the input parameters. APP specifies the root directory of the application, and APP_LAUNCHER is the class containing the main method that will be executed.
For the helloworld example, the command would look like : $ make app APP=./examples/helloworld APP_LAUNCHER=MyHelloWorld
The command is taking the APP/src directory as classpath by default, you can override this by APP_CLASSPATH="your:classpath"

Running on LEON3/RTEMS

Makefile tasks "make board" and "make board_cdx" are prepared so you can easily compile and run oSCJ on the board. However, see the readme files in doc/ for more details on preparing the environment for RTEMS compilation. $ make board To run oSCJ on the board, we recommend to use either Fedora or SUSE distributions that directly contain distributions of the RTEMS OS.


The oSCJ project is released under the New BSD License.