aspose file tools*
The moose likes Java in General and the fly likes JNI question... Rewriting j++ code issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JNI question... Rewriting j++ code issues" Watch "JNI question... Rewriting j++ code issues" New topic
Author

JNI question... Rewriting j++ code issues

Adrian Marti
Greenhorn

Joined: Sep 07, 2004
Posts: 11
Hello all,

Rewriting a small j++ application that uses a DLL and native call. I have the j++ source code but no source for the dll. I named my new class exactly the same and im using the same method call as the j++ code. I am not using a package as the j++ code doesnt use one either. Same method name, same class name etc. The only difference is my class extends JDialog while the j++ code extends mfc.forms (mS stuff). Anyways, when running the code i am getting an usatisfiredlinkerror. I know it is finding the right DLL, ( by using debugger) but it seems as though something is wrong when calling the method. I tried javah'ing my file and the j++ file to compare headers but it failed on the j++ file saying it could not locate mfc.forms... so does JNI take into account the class you are extending when u are creating a native method header? Is this my problem? i'm currently locating the ms packages to see if i can tell in the headers.


Thanks,

Adrian
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Microsoft never implemented JNI. Their JVM had its own native method mechanism. As a result, the same DLL can't be used with modern JVMs.


[Jess in Action][AskingGoodQuestions]
Adrian Marti
Greenhorn

Joined: Sep 07, 2004
Posts: 11
Wonderful! haha.

Thanks for the help, and saving me a headache.

Adrian
 
Don't get me started about those stupid light bulbs.
 
subject: JNI question... Rewriting j++ code issues
 
Similar Threads
How to use VB .dll in java
native keyword ?
x628 - finger print dll control + how with java
UnsatisfiedlinkError
UnsatisfiedLinkError in my first JNI program