Thursday Jun 05, 2014

Where are the values of java.library.path being set?

This one could be a WebLogic Server question, but this post is general for any java environment.

We were getting  at the very beginning  java library path something like this:

/home/lmestre/jdk1.6/jre/lib/amd64/server:/home/lmestre/jdk1.6/jre/lib/amd64:/home/lmestre/jdk1.6/jre/../lib/amd64

So, the question was:


Where WebLogic Server is setting java.library.path?

I never found the answer, so why don't we try to try to answer

Where the JVM is setting java.library.path?

public class LibraryPathPrinter {

   public static void main(String[] args) {
       String javaLibraryPath= System.getProperty("java.library.path");
       System.out.println("java.library.path "+javaLibraryPath );
   }

}

after a simple

javac LibraryPathPrinter.java

and then an easy

java LibraryPathPrinter

voila!

The program printed something like this

java.library.path  /home/lmestre/jdk1.6/jre/lib/amd64/server:/home/lmestre/jdk1.6/jre/lib/amd64:/home/lmestre/jdk1.6/jre/../lib/amd64

So the JVM was the culprit.
Enjoy!

About


My name is Luz Mestre. I work as Principal Technical Support Engineer at Oracle Support. I'll post here the most interesting challenges I have in my daily work. The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« June 2015
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
22
23
24
25
26
27
28
29
30
    
       
Today