• Post Reply Bookmark Topic Watch Topic
  • New Topic

loadLibrary()  RSS feed

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i'd like to know when i use
static{
System.loadLibrary("My");
}
where My.dll should be placed because i get
"no My in java.library.path" error.
And how can i change that path?
thank you in avance
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set java.library.path to be the directory where your DLL is located. For example,
java -Djava.library.path=c:\here\or\there MyProgram
If you don't want to set this property, then simply put the DLL in the current directory that you're running the program from. Another place that works is the c:\windows directory.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!