#!wml --include=..

#use wml::std::page
#use wml::std::lang
#use wml::fmt::isolatin
#use wml::std::case global=upper

<lang:new id=en short>
<lang:star:slice:>

<set-var last-modified-author="<mjw>">

#include <include/macros.wml>

<header title="GNU Classpath and ORP">
<en>
<p>
The Open Runtime Platform (<link
url="http://orp.sourceforge.net/" name="ORP">) 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. 
</p>

<H4>Steps to use ORP+GNU Classpath on GNU/Linux</H4>
<p>
Example assumes ORP 1.0.9, see above.  In the example, GNU Classpath sources
are in ~/src/classpath/.
</p>
<UL>
  <LI>Obtain <createlink url="http://sourceforge.net/projects/orp/" 
       name="ORP"> from the Sourceforge project page</LI>
  <OL>
    <LI><tt>wget
    http://prdownloads.sourceforge.net/orp/orp-1.0.9.tgz</tt></LI>
    <LI><tt>tar -xzvf orp-1.0.9.tgz</tt></LI>
  </OL>
  <LI>On some systems you might need to apply a patch to work around
  gcc compile problems</LI>
  <OL>
    <LI><tt>cd orp-1.0.9</tt></LI>
    <LI><tt>patch -p1 < ~/src/classpath/resource/orp-1.0.9.patch</tt></LI>
  </OL>
  <LI>Build ORP</LI>
  <OL>
    <LI><tt>make NON_ORP_NATIVE_LIBS=-DNON_ORP_NATIVE_LIBS dbg</tt></LI>
  </OL>
</UL>
<p>
ORP should now be built and ready, orp-1.0.9/mains/orp/Linux/dbg/orp.
</p>
<H4>Using ORP+GNU Classpath on GNU/Linux</H4>
<p>
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.
</p>
<UL>
  <LI>Set the LD_LIBRARY_PATH variable (assumes Bash shell)</LI>
  <OL>
    <LI><tt>export LD_LIBRARY_PATH=/usr/local/classpath/lib/classpath</tt></LI>
  </OL>
</UL>
<UL>
  <LI>Set the CLASSPATH variable (ORP doesn't yet use this but it
  makes the command line easier).</LI>
  <OL>
    <LI><tt>export CLASSPATH=/usr/local/classpath/share/classpath/:.</tt></LI>
  </OL>
</UL>
<UL>
  <LI>Running HelloWorld with ORP</LI>
  <OL>
    <LI>Create a <tt>HelloWorld.java</tt> file and compile to a class file
    with <tt>jikes</tt> or <tt>gcj -C</tt></LI>
    <LI><tt>orp-1.0.9/mains/orp/Linux/dbg/orp -swapjit 0 1 -classpath
    $CLASSPATH HelloWorld</tt></LI>
  </OL>
</UL>
<p>
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.
</p>
</en>
<footer>
