• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JNI

 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 {
System.loadLibrary("MML32DLL.dll");
} catch (Error e) {
System.out.println("Fejl ved indl�sning af maskinkode: " + e);
System.exit(1);
}
System.out.println("Opretter objekt.");
Cmethods objekt = new Cmethods();
System.out.println("Kalder metode implementeret i maskinkode.");
objekt.AttachToServer();
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 !!!
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I believe the problem is that you're not supposed to include the ".dll" here -- i.e., use just
 
Frank Jacobsen
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh, I must remember it.
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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.
Thanks.
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic