Welcome to OJ (f.a.k.a. OpenJava)

The next generation of preprocessor mechanism for Java
Last Modified on Oct 15, 2007.


OJ (f.a.k.a. OpenJava) is an extensible language based on Java(TM). The OJ MOP (Metaobject Protocol) is the extension interface of the language. Through the MOP, the programmers can customize the language to implement a new language mechanism. OJ helps people who want to develop better Java libraries, that is, easy-to-use and efficient ones. It also helps people who are developing their own extended Java languages. OJ can also be regarded as a toolkit for constructing a Java preprocessor.

The special feature of the OJ MOP is its class metaobject API, through which programmers can handle source code as object oriented language constructs. i.e. classes, methods, fields, .. Though its translation is performed at compile-time, interfaces are similar to Java Reflection API at runtime and easy to use for high-level translations. For instance, getting information about methods, adding methods, modifying methods and so on are easier.

It is fully written in Java of JDK 1.1, so it can be run on any platform which supports Java Virtual Machine of JDK 1.1 and Java2. And, the generated codes are written in regular Java language, so the user's products can be run on any platform which supports regular JVM.


  • Name OpenJava has been changed to OJ according to the request by Sun Microsystems. (Oct 15, 2007)
  • Now metaclasses can be bound to member (inner) classes. Caller-side syntax extension (type suffix) does not work in some case for inner classes. Separated meta-binding configuration is enhanced to allow use of wild card "*" and "-" for specifying base classes. (Nov 17, 2001) new


OJ 1.1 is available. new

And some documents are available online though they are included in the downloadable packages.

Additionally, if you need, OJ 0.2.x (old simple version) is still available from Download Page.

CVS server for the latest source code of OJ is available. new
Try to login our CVS authentication server:

cvs -d:pserver:anonymous@cvs.openjava.sourceforge.net:/cvsroot/openjava login
with the empty password. Then check out the module:
cvs -z3 -d:pserver:anonymous@cvs.openjava.sourceforge.net:/cvsroot/openjava co OJ_1.1
You can only check out with this account. For commiting, please directly mail at:
We will issue your account.

Mailing List...

Visit SourceForge mailing list at: http://sourceforge.net/mail/?group_id=48357



  • Now metaclasses can be bound to member (inner) classes. Caller-side syntax extension (type suffix) does not work in some case for inner classes. Separated meta-binding configuration is enhanced to allow use of wild card "*" and "-" for specifying base classes. (Build 20011117) new
  • Environment-conscious customized-suffixes are now enabled. A static method getDeclSuffix(Environment,String) can be declared in OJClass subclasses to make use of it. (Build 20010425)
  • A bug of reporting NoSuchMemberException even for accessible innerclass's or outerclass's member is fixed. The class NullCompiler for people who want not to generate bytecode is added. (Build 20001010)
  • A bug in parsing an array-typed member fields declaration is fixed. Declarations in a certain kind of syntax style was wrongly reconized. (Build 20000905)
  • The class openjava.ptree.util.EvaluationShuttle is implemented completely. Some performance tuning of translation at caller-side. (Build 20000627)
  • The bug of OJClass.isAssignableFrom() for array types is fixed. (Build 20000509)
  • A bug in parsing some anonymous classes are fixed. A compiler option to turn off caller-side translation is added. (Build 20000124)
  • OJClass.addClass(), OJConstructor.setExceptions() OJConstructor.addException() are added. A bug in SelfAccess.constantSuper() is fixed. (Build 19990626)
  • The bug to fail to write a simple constructor is fixed. (Build 19990528).
  • Some bugs are fixed. (Build 19990527)
  • A few tutorials are added. (Build 19990525)
  • Some exceptions thrown in the API are changed to be convenient. ojc.exe for Windows95/98/NT platform without ksh is included. (Build 19990520)
  • Some comments for OJClass are partialy added. (Build 19990513)
  • Some lacks in the API of OJClass are supplemented. (Build 199990508)
  • Bugs in partial parser are fixed. (Build 199990507)
  • Bugs around innerclasses are fixed. (Build 19990505)
  • The first OJ 1.0 alpha is released. (Build 19990430)

Related Work...

We are developing other reflective systems for C++ and Java.


An extensible C++ preprocessor based on compile-time reflection.


A class library for editing bytecodes in Java; it enables Java programs to define a new class at runtime and to modify a class file when the JVM loads it. Unlike other similar systems, Javassist is based on reflection and hence it provides higher-level abstraction.


Java and all Java-based marks are a trademark or registered trademark of Sun Microsystems, Inc.

Please send any message to :


Michiaki Tatsubori

SourceForge Logo
Copyright (C) 1998-2002 by Michiaki Tatsubori.
Java(TM) is a trademark of Sun Microsystems, Inc.