#!wml --include=.. #use wml::std::page #use wml::std::lang #use wml::fmt::isolatin #use wml::std::case global=upper #include

The Open Runtime Platform () provides a covenient and simple platform for both using and testing GNU Classpath. With the release of ORP 1.0.9, GNU Classpath's native libraries are supported out of the box.

Steps to use ORP+GNU Classpath on GNU/Linux

Example assumes ORP 1.0.9, see above. In the example, GNU Classpath sources are in ~/src/classpath/.

  • Obtain from the Sourceforge project page
    1. wget http://prdownloads.sourceforge.net/orp/orp-1.0.9.tgz
    2. tar -xzvf orp-1.0.9.tgz
  • On some systems you might need to apply a patch to work around gcc compile problems
    1. cd orp-1.0.9
    2. patch -p1 < ~/src/classpath/resource/orp-1.0.9.patch
  • Build ORP
    1. make NON_ORP_NATIVE_LIBS=-DNON_ORP_NATIVE_LIBS dbg

ORP should now be built and ready, orp-1.0.9/mains/orp/Linux/dbg/orp.

Using ORP+GNU Classpath on GNU/Linux

ORP needs to load shared libraries and the class library bytecode. The recommended method is to use the environment variable LD_LIBRARY_PATH to provide a colon separated list of directories in which to look for GNU Classpath's shared libraries. The example below assumes the user built and installed GNU Classpath without modifing the default prefix.

  • Set the LD_LIBRARY_PATH variable (assumes Bash shell)
    1. export LD_LIBRARY_PATH=/usr/local/classpath/lib/classpath
  • Set the CLASSPATH variable (ORP doesn't yet use this but it makes the command line easier).
    1. export CLASSPATH=/usr/local/classpath/share/classpath/:.
  • Running HelloWorld with ORP
    1. Create a HelloWorld.java file and compile to a class file with jikes or gcj -C
    2. orp-1.0.9/mains/orp/Linux/dbg/orp -swapjit 0 1 -classpath $CLASSPATH HelloWorld

ORP contains two JITs at this time. By default ORP uses a so-called JIT 3 and for some things it appears to have more problems than when using JIT 1. This is the reasoning behind adding the -swapjit 0 1 argument to ORP. ORP does not have the ability at this time to execute raw bytecode and must use one of these two JIT compilers.