FYI: Article "Building GCJ on Windows" Relocated

Rutger Ovidius r_ovidius@eml.cc
Sat Apr 22 15:35:00 GMT 2006


Friday, April 21, 2006, 2:33:41 AM, you wrote:

RM> -----BEGIN PGP SIGNED MESSAGE-----
RM> The only saving grace is that GCJ is able to create
RM> .class files (but not object files, since it uses the
RM> same driver as the rest of the GCC) and "gij" is able
RM> to run interpreted programmes. So at least "libgcj.jar"
RM> is located properly when the toolchain is relocated.

Just to add to the list of win32 problems:

System.loadLibrary() does not work without the hack from here:

http://gcc.gnu.org/ml/java/2006-02/msg00066.html

Class.forName() does not work because java/lang/natClass.cc ::forName
uses stacktrace.cc ::GetCallingClass which can not work with SJLJ
exceptions.  (this is a regression; Class.forName() worked in previous
versions).

Simple test attached for anyone that wants to try.

javac HelloWorld.java
javah -o HelloWorld.h HelloWorld
gcc -Ie:\java\include -Ie:\java\include\win32 -Wl,--add-stdcall-alias -shared -o HelloWorld.dll HelloWorld.c
gcj -fjni --main=HelloWorld -o HelloWorld HelloWorld.java

Works with Sun's java and GCJ 4.0, but not 4.2 at this time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelloWorld.c
Type: application/octet-stream
Size: 165 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20060422/7a0ca02b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelloWorld.java
Type: application/octet-stream
Size: 539 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20060422/7a0ca02b/attachment-0001.obj>


More information about the Java mailing list