This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/18278] JNI functions cannot return a weak reference
- From: "laurent at bearteam dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Nov 2004 20:38:55 -0000
- Subject: [Bug java/18278] JNI functions cannot return a weak reference
- References: <20041102185341.18278.laurent@bearteam.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From laurent at bearteam dot org 2004-11-02 20:38 -------
Created an attachment (id=7461)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7461&action=view)
Sample java code
Here's how I compiled to whole thing:
cc -c weakref.c -o weakref.o
cc -shared -Xlinker --no-undefined weakref.o -o libweakref.so
gcj -o JNIWeakRef --main=JNIWeakRef -L . -l weakref -fjni JNIWeakRef.java
And then run with like this:
laurent@stan:~/tmp/gc$ LD_LIBRARY_PATH=. ./JNIWeakRef
Exception in thread "main" java.lang.ClassCastException:
gnu.gcj.runtime.JNIWeakRef cannot be cast to JNIWeakRef
at _Jv_CheckCast (/usr/lib/libgcj.so.6.0.0)
at JNIWeakRef.main(java.lang.String[]) (Unknown Source)
Sun's JVM (1.4.2) has no problem with it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18278