This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: JNI Problems


> I thought libltdl worked fine on Windows.  Is that
> not the case?

When I try to run a JNI application on Windows, I get:

   Exception in thread "main" java.lang.UnknownError:
   Runtime.loadLibrary not implemented

I just did some research and found this in
libjava/configure.in:

   # Only use libltdl for native builds.
   if test -z "${with_cross_host}"; then
      AC_LIBLTDL_CONVENIENCE
      AC_LIBTOOL_DLOPEN
      DIRLTDL=libltdl
      AC_DEFINE(USE_LTDL)

I looks like libltdl isn't supported with cross
compilers. I wonder if there is any way around this?

:-) Frank

--- Tom Tromey <tromey@redhat.com> wrote:
> >>>>> "Frank" == Frank Jacobs <forkjake@yahoo.com>
> writes:
> 
> Frank> AFAIK, JNI under Windows with GCJ is not
> supported yet. If you
> Frank> look at java/lang/natRuntime.cc, the support
> for loading
> Frank> libraries for Windows is turned off.
> 
> Frank> Lately, I've been thinking about how hard it
> would be to
> Frank> implement this... My initial (naive) thought
> is that it
> Frank> wouldn't be that hard. The Windows API call
> LoadLibrary should
> Frank> do it for us.
> 
> I thought libltdl worked fine on Windows.  Is that
> not the case?
> 
> The `!WIN32' code in Runtime::_load has to do not
> with mangling the
> library name on Windows.
> 
> Kailas, how did you compile your program?
> Did you remember to use `-fjni'?  (I assume so.)
> Does your program try to load the library containing
> the JNI code?
> 
> Tom


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]