This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

Using Cygwin 1 with Mumit's JNI examples


I'm using the Cywin 1.0 CD and have downloaded Mumit's JNI examples,
but I can't get them to work!

What I've done:

/1/ download and unzip java-jni-examples.zip from
    http://www.xraylith.wisc.edu/~khan/software/gnu-win32/

/2/ go to the c++ sub-directory

/3/ copy Makefile.cyg to Makefile

/4/ Add the following lines after the respective defines:
    CPPFLAGS+= -D__int64="long long"
    JDK_ROOT = c:/Java/jdk1.2.2
    DLLWRAP_FLAGS+= --target=cygwin32 	

/5/ type "make". This appears to build the dll successfully.

*But* now when I run the Main application it exits with no apparent
results. So...

/6/ I changed the initialiser in HelloWorld.java to...

    static {
        try
        {
            System.out.println("arg debug: before loadLibrary");
            System.loadLibrary("hello");
        }
        finally
        {
            System.out.println("arg debug: after loadLibrary");
        }
    }

...and discovered that the first println() is executed and the second isn't. 
(If I delete the dll I reach the second println() and have the expected
UnsatisfiedLinkError trace.)

Clearly something is going horribly wrong with loading the dll. But I don't
have the first idea what to look for.  Any suggestions?

PS 
Thanks Mumit for pointing me at the list archive - which had  answers to
some of my earlier difficulties.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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