Help!

I tried every classes.zip file I could and none of them worked. In the
file INSTALL it says the blackdown 1.1.5 glic port was known to work
but it also gives me the same error and crash. When I got sick of that
I decided to hack the source to java/lang/System.java myself to see
if I could get something working. What I found out kind of confused me.
There is a test for the method "void initializeSystemClass()" inside
one of the japhar sources. It prints out the warning when this method
is found. Every classes.zip I have looked at has this method. The real
problem is not the name of the method but the implementation. The System
class does a nasty little trick where it makes System.in, System.out, and
System.err public and final so that they can not be changed from java
code. They then provide methods setIn() setErr() and setOut() to change
them in native code. The problem is that these methods call native
the methods setIn0 setOut0 setErr0 to actually set the values. This
is what seems to be missing in japhar. My question is how does japhar
handle setting of the System.in, System.out, and System.err if it is
not going to do it the same way as the sun JDK? I did some hacking to
try to work around this problem so that I could run japhar but my approach
does not seem like "the right thing to do". I just made the vars public
and non final and then set the directly in System.java. Then I
uncompressed the classes.zip that came with jdk1.1.6 from sun and replaced
the java/lang/System.class file with my own. After that I was able to
run a simple hello world application on my sun box (yeah). I did notice
a problem with japhar in that it did not flush System.out when System.exit
is called so I had to put in a flush before I could see any output.
After all of that I am going to call it a day.



Mo DeJong
dejong at cs.umn.edu

Reply via email to