This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes JNI  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JNI  " Watch "JNI  " New topic


Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 358
Can anyone tel me why this dosent work, i have to classes:
Class 1:
public class Cmethods {

public native void AttachToServer();
Class 2:
public class RPCClient {
public static void main(String[] args) {
System.out.println("Indl�ser maskin kode");
try {
} catch (Error e) {
System.out.println("Fejl ved indl�sning af maskinkode: " + e);
System.out.println("Opretter objekt.");
Cmethods objekt = new Cmethods();
System.out.println("Kalder metode implementeret i maskinkode.");
System.out.println("lige efter kald til attach");
I call my program from the dos prompt:
java -Djava.libary.path=. -classpath . RPCClient
I get this exception:
java.lang.UnsatisfiedLinkError: no MML32DLL.dll in java.library.path
I don�t understand this exception, becouse my Dll is in the same path as my class files in the directory, where im running my application, and i got the libary.path ???
Help !!!
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

I believe the problem is that you're not supposed to include the ".dll" here -- i.e., use just

[Jess in Action][AskingGoodQuestions]
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 358
YEHHHHHH, your the best !

In all the examples i saw at google and other places, the .ddl was in the code....
But it works without the .ddl
Thanks a lot !
Scott Ding

Joined: Nov 27, 2002
Posts: 13
oh, I must remember it.
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Is it Possible to pass some arguments to that method like given below.
<B>public native void AttachToServer(String str);</B>
If then that C function also has to take the same String as a parameter.

Don't get me started about those stupid light bulbs.
subject: JNI
It's not a secret anymore!