[PLUG] Java, Jikes, and Linux

Jason Van Cleve jason at vancleve.com
Mon May 23 19:25:18 UTC 2005


Quoth Keith Lofstrom, on Mon, 23 May 2005 11:21:12 -0700:

> Not nearly that far along.  Apparently, to make jikes work, I must
> set some environment variables like CLASSPATH.  I have no clue where

Ah, okay, this is an easy one.  Jikes just needs to know where to find
the core java library, which is probably "$JAVA_HOME/jre/lib/rt.jar".

If you set $JAVA_HOME, jikes may be able to find it that way, but you
might as well set a system-wide $CLASSPATH that includes that JAR.  If
you do neither of those, then jikes has no way of knowing the which and
the where of it.

Here's a safer option:  write yourself a wrapper script for invoking
jikes, that sets the classpath beforehand or passes it to jikes as an
option (an alias would also work).  You can even name the script "jikes"
and put it at the front of your path, if you like.  I actually have
different jikes wrappers for different projects, since they all have
different classpaths (often different sourcepaths as well).

> me *where* to point them, or how to figure that out, would be handy.
> It is stupid to have to ask when it should be documented somewhere.

There are a couple references in the man page to "java/jre/lib/rt.jar",
but it doesn't explicitly tell you to add that in when invoking jikes. 
The basic idea is that jikes is javac compatible; but javac knows where
to find that rt.jar by the location of the executable.  jikes doesn't
have that advantage.  So yeah, explicit mention of this discrepancy
would be helpful.

--Jason

--
Do not try and fix the bug.  That's impossible.  Instead, only try to
realize the truth. . . .  There is no bug.  Then you'll see that it is
not the code that errs:  it is only the user.



More information about the PLUG mailing list