🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: aus.computers.java
2 messages
2 total messages Started by Duke Biswas Fri, 13 Aug 1999 00:00
JNI --- please help me
#1060
Author: Duke Biswas
Date: Fri, 13 Aug 1999 00:00
42 lines
1884 bytes
Hi I am bit new in JNI implementation. But I 've done number of reading from
various different web sites about JNI Specification. But still i am having
"java.lang.UnsatisfiedLinkError: GenerateKeyPair at
testHICDll.main(testHICDll.java:20)"
Exception.

(I am using NT and I have set the Path for dps.dll library which is in
c:\dps directory.)

The code :
~~~~~~~~
public class testHICDll {
   native short GenerateKeyPair(String password);
    static {
        try {
           System.loadLibrary("dps");
        } catch (UnsatisfiedLinkError e) {
            System.err.println("can't find your library");
            System.exit(-1);
        }

    }

  public testHICDll() {
  }

  public static void main(String[] args) {
    testHICDll test = new testHICDll();
    test.GenerateKeyPair("MNA00002"); // <- it fails in here
  }
}

after writing the code, I have taken the following steps
1> run javac testHICDll.java
2> run javah -jni testHICDll - this created testHICDll.h file
3> run java testHICDll



The Dll is written in VC5++ and the function description for GenerateKeyPair
is
          short CDPSCtrl::GenerateKeyPair( LPCTSTR lpszPassword)
Re: JNI --- please help me
#1061
Author: Kevin Greenwood
Date: Fri, 13 Aug 1999 00:00
29 lines
1632 bytes
On Fri, 13 Aug 1999 10:45:47 +1000, "Duke Biswas"
<dbiswas@mednet.com.au> wrote:

<snip>
>after writing the code, I have taken the following steps
>1> run javac testHICDll.java
>2> run javah -jni testHICDll - this created testHICDll.h file

Duke,
     You missed a step here, you should build your dll from the header
file created by javah. The function prototypes must be exactly what
was created by javah or it will not work, this is after all the
purpose of the program.

>3> run java testHICDll


cheers
Kevin
=====================================================
Kevin Greenwood
=====================================================
e-mail greenwok@mackay.net.au
phone +61 7 49423758
fax      +61 7 49427043
=====================================================
Several week spent on testing and development can 
easily replace an afternoon wasted in the library
=====================================================
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads