• 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

What is java.library.path?

 
Ranch Hand
Posts: 107
  • 2
  • Number of slices to send:
    Optional 'thank-you' note:
Hi,

I wonder what is java.library.path? where should i set this and how?

please guide.

 
Greenhorn
Posts: 5
  • Number of slices to send:
    Optional 'thank-you' note:
Hi, Vanchi,

Your application tries to load a native library called liblwjgl.so (Linux) or lwjgl.dll (Windows).
Check to see if this file exists and what it's file permissions are.
This problem most often shows up because the file does not exist, has incorrect file permissions, or can not be located by the JVM.

Under Linux set LD_LIBRARY_PATH.
Under Windows set PATH.
 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Number of slices to send:
    Optional 'thank-you' note:
Hi Alex,

Thanks, I found the lwjgl.dll files, there are about 4 dll files. Where should i put them?

How to find out that JVM is looking for a '.dll' or '.so' module from the exception thrown?

regards,

 
author and iconoclast
Posts: 24207
46
  • 1
  • Number of slices to send:
    Optional 'thank-you' note:
The message says "java.lang.UnsatisfiedLinkError: no lwjgl in java.libr
ary.path". The "lwjgl" is interpreted in a platform-dependent way. On Windows, it means LWJGL.DLL . On Linux and many other UNIX variants, it means "liblwjgl.so". On other platforms, it may mean something else. You're just supposed to know what it means on your platform.

Since you're on windows, just make sure the file(s) are in a directory named on your PATH environment variable; you could add an entry if need be.
 
Ranch Hand
Posts: 443
3
  • Number of slices to send:
    Optional 'thank-you' note:
From memory JNI is a bit of a pain (on Windows any way) in that it can also say it can't find things when it means it can't load things so if your DLL needs another DLL you can sometimes get this error.
 
Java Cowboy
Posts: 16084
88
  • Number of slices to send:
    Optional 'thank-you' note:
java.library.path is the path that Java uses to find native libraries (such as lwjgl.dll). You should set it to the directory that contains the DLL files. You specify this with the -D switch on the command line, for example:

java -Djava.library.path=C:\Java\ljwgl\libs org.mypackage.MyProgram

*edit* Oh, this is an old topic from 2005. (Chris, the original poster is most likely not still waiting for an answer...).
 
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:
java.library.path is the path that Java uses to find native libraries (such as lwjgl.dll).
 
Marshal
Posts: 79422
377
  • Number of slices to send:
    Optional 'thank-you' note:
Nitin Harane welcome to the Ranch
 
Greenhorn
Posts: 17
  • Number of slices to send:
    Optional 'thank-you' note:
Does it override all the set path via -Djava.library.path?
 
Ranch Hand
Posts: 55
  • Number of slices to send:
    Optional 'thank-you' note:
java.lang.UnsatisfiedLinkError: no CommonControl in java.library.path?
Here Common control means ?Exactly what i have to include in path?
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
  • Number of slices to send:
    Optional 'thank-you' note:
"CommonControl" is the name of the native library that Java is looking for. If this is on Windows, it's looking for a file named "CommonControl.dll".

You'll have to include the name of the directory that contains CommonControl.dll in the java.library.path.
 
Greenhorn
Posts: 4
  • Number of slices to send:
    Optional 'thank-you' note:
Hi vanchin

From your question, i assumed that, you are trying load a native library

There are two ways you can load the native library

1. System.loadLibrary(String)
2. System.load(String)

System.loadLibrary(String) uses the default path.
System.load(String) uses the absolute path

Assume, you are working on the windows environment

The JVM will search for your dll file in java.library.path system property

If your dll directory is not specified in the java.library.path system property, you get this error.

Sankar.lp.gym
 
Greenhorn
Posts: 9
  • Number of slices to send:
    Optional 'thank-you' note:
I've set java.library.path like this:
JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=512m -Djava.library.path=C:/apache-tomcat-6.0.36/lib/ocijdbc11.dll"
but I' m getting attached error.
err2.jpg
err1.jpg
 
Rudra Nath
Greenhorn
Posts: 9
  • Number of slices to send:
    Optional 'thank-you' note:
I added kernel32.dll,msvcr80 and ocijdbc11.dll in tomcat/bin folder; still I'm facing error: UnsatisfiedLinkError:
error.jpg
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
  • Number of slices to send:
    Optional 'thank-you' note:
Don't let java.library.path point to the DLL itself, but to the directory that contains the DLL:

-Djava.library.path=C:/apache-tomcat-6.0.36/lib

NOT: -Djava.library.path=C:/apache-tomcat-6.0.36/lib/ocijdbc11.dll
 
reply
    Bookmark Topic Watch Topic
  • New Topic
vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |