Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

How do you set a library path in java ?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey... I get the error message...

java.lang.UnsatisfiedLinkError: nativeLoadProlog
at Int386w.nativeLoadProlog(Native Method)
at Int386w.loadProlog(INT386w.java:28)
at FlexIS.loadFlex(FlexIS.java:21)
at FlexEG.<init>(FlexEG.java:30)
at FlexEG.main(FlexEG.java:18)

How do you set a library path in java??
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't set it in java, but in the OS.
On linux:
 
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
That's one way -- works on UNIX variants only. You can also put the libraries on the PATH (works for Windows only). Or you can do things the portable way, and use the special system property for this: it's java.library.path, as in

java -Djava.library.path=c:\wherever Foo

Now, "Kesh", you need to check out our policy on display names, and adjust your accordingly by visiting this page. Thank you kindly!
 
Keshini Weerasuriya
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi... Thanks for your help.. I'm trying to connect flex (expert system shell) with java..

Even though i set the library path it still doesn't seem to work..........
Can u suggest any other way?? why do i keep on getting the same error??
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The java.library.path thing does work fine, as does LD_LIBRARY_PATH on Unix-like platforms. If your program isn't working, then you need to look carefully at what files are where etc. and to read the JNI documentation carefully.

There are other ways to connect Java native methods to their underlying native implementations. Your native code can load the library itself explicitly, using platform-specific code (e.g. LoadLibrary() on Windows). It can then use the JNI RegisterNatives() function to link functions in the library to Java native methods. This also frees you from naming the native functions according to the rather long-winded JNI function names.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ernest Friedman-Hill:
Or you can do things the portable way, and use the special system property for this: it's java.library.path, as in

java -Djava.library.path=c:\wherever Foo


c: - very portable, indeed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic