curiousity
curiousity

Reputation: 4741

Tomcat -Djava.library.path set

I am trying to point a -Djava.library.path in setenv.sh file. My library is in usr/lib64 folder but when I am trying to do something like :

EXPORTS JAVA_OPTS="-Dcom.site.host=site.com -Dcom.site.storage.path=/usr/hosting/site.com/db -Dcom.site.lib=/usr/lib64/mylib.so"

I am getting :

error : Directory separator should not appear in library name : /usr/lib64/mylib.so

How to set it correctly?

mylib.so is already present in usr/lib64

Upvotes: 0

Views: 4247

Answers (2)

Kuntal-G
Kuntal-G

Reputation: 2981

export LD_LIBRARY_PATH="usr/lib64:$LD_LIBRARY_PATH"

Now run your Java program.

Upvotes: 1

Jimmysnn
Jimmysnn

Reputation: 593

You can create an new variable for java path where exist native library or copy paste your native library to default java.path.

set environment variables as follows

Edit the system Path file /etc/profile

sudo gedit /etc/profile

Add following lines in end

JAVA_HOME=/usr/lib/jvm/jdk1.7.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

Finaly set VMOption: -Djava.library.path="path_to_native_library"

Upvotes: 1

Related Questions