• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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: 24204
44
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
  • 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.
 
Nothing up my sleeve ... and ... presto! A tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic