System.setProperty("java.library.path")  question

Is there a way to dynamically specify which directories the System.loadLibrary picks up its DLL's and libraries from ?
I have read a few places saying no, however, WHY even have a System.setProperty("java.library.path") function? If there truly is not, then can there be a jni directory added to the WAR directory structure so that tomcat et. al. can access them

Is there a way to dynamically specify which
directories the System.loadLibrary picks up its DLL's
and libraries from ?No.
You can however use System.load().
I have read a few places saying no, however, WHY even
have a System.setProperty("java.library.path")
function? That are many reasons for having setProperty(). For example if you want to set your own property.
If there truly is not, then can there be a
jni directory added to the WAR directory structure
so that tomcat et. al. can access themBecause it extracts them into a directory which is in the OS path presumably.
The OS, not java, loads shared libraries. And that means that the OS has to be able to find it. So JNIs are not loaded from a war/jar. They must be extracted first.

Similar Messages

  • System.setProperty("java.class.path", cp)

    hello,
    I have written a little program that is supposed to set the CLASSPATH var in a instance of
    bash ... not set it permantly. Anyway, after running the program when i run,
    echo $CLASSPATH
    none of the changes i make with the program are there.... why is this?
    thanks,
    jd
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import layout.TableLayout;
    import com.incors.plaf.kunststoff.KunststoffLookAndFeel;
    public class JPathGui extends JFrame{
         JButton cpSubmit;
         JButton cpClear;
         JButton qaSubmit;
         JButton qaClear;
         JTextField cptf;
         JTextField qatf;
         public JPathGui(){
              super("JPATH ver .001");
              try {
                        UIManager.setLookAndFeel(new KunststoffLookAndFeel());
                 } catch (Exception ignored) {}
              addWindowListener(new WindowAdapter()
                     public void windowClosing(WindowEvent e){
                    System.exit(0);
              JPanel mainPanel = new JPanel();
              mainPanel.setPreferredSize(new java.awt.Dimension(800,230));
              double[][] size = {{10,780,10},{20,30,5,30,10,20,30,5,30}};
            TableLayout layout = new TableLayout(size);
            mainPanel.setLayout(layout);
              myGetClassPath(mainPanel);
              myQuickAdd(mainPanel);          
              getContentPane().add(mainPanel);
              pack();
            setSize(820,230);
            setVisible(true);
         public void myGetClassPath(JPanel mainPanel){
              JLabel cpl = new JLabel("ClassPath");
              JPath jp = new JPath();     
              cptf = new JTextField(jp.getClassPath());
              cptf.setFont( new Font("Monospaced", Font.PLAIN, 10) );
              cptf.setPreferredSize(new java.awt.Dimension(780,50));
              mainPanel.add(cpl, "1,0");
              mainPanel.add(cptf, "1,1");
              JPanel cpActionPanel = new JPanel();
              cpActionPanel.setPreferredSize(new java.awt.Dimension(780,50));
              double[][] size1 = {{570,100,100,30},{30}};
            TableLayout layout1 = new TableLayout(size1);
            cpActionPanel.setLayout(layout1);
              cpSubmit = new JButton("Submit");
              cpClear = new JButton("Clear");
              cpSubmit.setSize(40,20);
              cpClear.setSize(40,20);
              cpSubmit.addMouseListener(new command_listner());
              cpClear.addMouseListener(new command_listner());
              cpActionPanel.add(cpSubmit , "1,0");
              cpActionPanel.add(cpClear, "2,0");
              mainPanel.add(cpActionPanel, "1,3");
         public void updateCPTF(){
              JPath jp = new JPath();     
              cptf.setText(jp.getClassPath());
         public void myQuickAdd(JPanel mainPanel){
              JLabel qal = new JLabel("QuickAdd");
              qatf = new JTextField();
              qatf.setFont( new Font("Monospaced", Font.PLAIN, 10) );
              qatf.setPreferredSize(new java.awt.Dimension(780,50));
              mainPanel.add(qal, "1,5");
              mainPanel.add(qatf, "1,6");
              JPanel qaActionPanel = new JPanel();
              qaActionPanel.setPreferredSize(new java.awt.Dimension(780,50));
              double[][] size2 = {{570,100,100,30},{30}};
            TableLayout layout2 = new TableLayout(size2);
            qaActionPanel.setLayout(layout2);
              qaSubmit = new JButton("Submit");
              qaClear = new JButton("Clear");
              qaSubmit.setSize(40,20);
              qaClear.setSize(40,20);
              qaSubmit.addMouseListener(new command_listner());
              qaClear.addMouseListener(new command_listner());
              qaActionPanel.add(qaSubmit , "1,0");
              qaActionPanel.add(qaClear, "2,0");
              mainPanel.add(qaActionPanel, "1,8");
         public class command_listner extends MouseAdapter{
                 public void mouseClicked(java.awt.event.MouseEvent evt){
                       Object source = evt.getSource();
                   //cpSubmit
                   if(source == cpSubmit){
                        JPath jp = new JPath();
                        String newCP = cptf.getText();
                        boolean b = false;
                        String olcp = jp.setClassPath(newCP,b);
                        updateCPTF();
                   //cpClear
                   else if(source == cpClear){
                        updateCPTF();
                   //qaSubmit
                   else if(source == qaSubmit){
                        JPath jp = new JPath();
                        String newCP = qatf.getText();
                        boolean b = true;
                        String olcp = jp.setClassPath(newCP,b);
                        qatf.setText(null);
                        updateCPTF();
                   //qaClear
                   else if(source == qaClear){
                        qatf.setText(null);
         public class JPath {
              public String getClassPath(){
                   String cp = System.getProperty("java.class.path");
                   return cp;
              public String getPathSep(){
                   String ps = System.getProperty("path.separator");
                   return ps;
              public String getUserName(){
                   String un = System.getProperty("user.name");
                   return un;
              public String getUserHome(){
                   String uh = System.getProperty("user.home");
                   return uh;
              public String getOSName(){
                   String osn = System.getProperty("os.name");
                   return osn;
              public String getOSVersion(){
                   String osv = System.getProperty("os.version");
                   return osv;
              public String setClassPath(String newClassPath, boolean append){
                   String oldClassPath = null;
                   if(append){
                        String cp = getClassPath() + getPathSep() + newClassPath;
                        System.out.println("from setClassPath" + cp);
                        oldClassPath = System.setProperty("java.class.path", cp);
                   else{
                        System.out.println("else - " + newClassPath);
                        oldClassPath = System.setProperty("java.class.path", newClassPath);
                   return oldClassPath;          
         public static void main(String[] args){
              JPathGui jpg = new JPathGui();
    }     

    Two reasons:
    1) Setting the system property java.class.path does not change the value of the CLASSPATH environment variable in the first place.
    2) Even if it did, the change would not be visible in the original shell because the environment of the Java subprocess is destroyed. You can't change the environment of the parent process from any subprocess, including shell scripts. (That's why you have to "source" and not run .bashrc or .profile to customize environment settings)

  • How to set java.library.path form code

    I'm new to JNI. I see there are several ways to set JVM to look for libraries dll, so, etc.
         System.setProperty("java.library.path", ".");
         System.loadLibrary("hello");That's when UnsatisfiedLinkError
    java.lang.UnsatisfiedLinkError: no hello in java.library.path
         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
         at java.lang.Runtime.loadLibrary0(Runtime.java:822)
         at java.lang.System.loadLibrary(System.java:992)
         at HelloWorld.main(HelloWorld.java:17)But if I comment the line that sets the java.library.path and call the program with the command java -Djava.library.path=. HelloWorld works.
    The question is: Why is not working? How should it be the property setup? I rather don't set Variables, or use -D option.
    Thanks in advance.
    PD: If it helps I'm using JDK 1.5.0_01 on Linux kernel 2.6.8

    well i wrote the script and everything is fine! i can run the blackbox example on the commapi.
    But i am writing another program using netbeans to send some data to a PIC microcontroller using the serial port (that is why i installed the commapi), and when i'm trying to build it or run it on netbeans throws this error:
    Error loading LinuxSerialParallel: java.lang.UnsatisfiedLinkError: no LinuxSerialParallel in java.library.path
    Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink
    at com.sun.comm.Unix.isDevLink(Native Method)
    at com.sun.comm.PathBundle.add(PathBundle.java:108)
    at com.sun.comm.PlatformPortBundle.<init>(PlatformPortBundle.java:44)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
    as far as i know it seems to be missing a library (LinuxSerialParallel), if this is right, adding the library would solve the error?how can i add the library? is there another way to solve this?
    thanks in advance!!

  • HELP: java.lang.UnsatisfiedLinkError: no ... in java.library.path

    am the beginner of JNI. I write a test program to use C code in JAVA.
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.java theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ javac AClassWithNativeMethods.java
    [yxz155@lionxo JAVAaC]$ javah -jni AClassWithNativeMethods
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.class AClassWithNativeMethods.java
    AClassWithNativeMethods.h theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ gcc -c -fPIC -I/usr/global/java/include -I/usr/global/java/include/linux theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.class AClassWithNativeMethods.java theNativeMethod.o
    AClassWithNativeMethods.h theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ ld -G theNativeMethod.o -o libJCI.so -lm -lc -lpthread
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.class AClassWithNativeMethods.java theNativeMethod.c
    AClassWithNativeMethods.h libJCI.so theNativeMethod.o
    [yxz155@lionxo JAVAaC]$ java AClassWithNativeMethods
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no CJI in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:992)
    at AClassWithNativeMethods.<clinit>(AClassWithNativeMethods.java:9)
    [yxz155@lionxo JAVAaC]$
    The codes are as follows, I tried setProperty() as in java program, but it did not work. I also tried set LD_LIBRARY_PATH and it did not work either.
    //AClassWithNativeMethods.java
    import java.io.File;
    import java.lang.System;
    public class AClassWithNativeMethods{
    public native void theNativeMethod();
    static {
    //System.setProperty("java.library.path",System.getProperty("java.library.path")+ File.pathSeparator+"/home2/yxz155/JAVAaC");
    //System.out.println(System.getProperty("java.library.path"));
    System.loadLibrary("CJI");
    public static void main(String[] args){
    AClassWithNativeMethods test = new AClassWithNativeMethods ();
    test.theNativeMethod();
    // theNativeMethod.c
    #include <stdio.h>
    #include "AClassWithNativeMethods.h"
    JNIEXPORT void JNICALL Java_AClassWithNativeMethods_theNativeMethod
    (JNIEnv *env, jobject obj){
    printf("Hello~~~~");
    //AClassWithNativeMethods.h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class AClassWithNativeMethods */
    #ifndef IncludedAClassWithNativeMethods
    #define IncludedAClassWithNativeMethods
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: AClassWithNativeMethods
    * Method: theNativeMethod
    * Signature: ()V
    JNIEXPORT void JNICALL Java_AClassWithNativeMethods_theNativeMethod
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif

    Hi all,
    I am getting the error in jdk 5:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: getObjectSize0
    at sun.instrument.InstrumentationImpl.getObjectSize0(Native Method)
    at sun.instrument.InstrumentationImpl.getObjectSize(InstrumentationImpl.java:97)
    at ObjectSizeEstimator.main(ObjectSizeEstimator.java:25)
    while executing the following code:
    public class ObjectSizeEstimator {
    static {
    System.loadLibrary("instrument");
    public static void main(String[] args) throws Exception {
    Constructor ctor = InstrumentationImpl.class
    .getDeclaredConstructor(new Class[] { long.class, boolean.class });
    ctor.setAccessible(true);
    Instrumentation inst = (Instrumentation) ctor.newInstance(new Object[] {
    Long.valueOf(0L), Boolean.TRUE });
    System.out.println(inst.getObjectSize(new Object()));
    "getObjectSize0" is the native method. All of my classpath setting is in place. Can Anybody tell me why i am getting this error.
    Thanks in advance....:)

  • Setting java.library.path property in java code

    Hi,
    i'd like to set java.library.path property in java code to load a dll-library. I know that a funtional way is to run JVM with parameter -Djava.library.path=c:\tmp, but I need it do it IN CODE.
    I'v tried this:
    System.setProperty("java.library.path", "c:\\tmp");
    System.loadLibrary("libapr");The library 'libapr.dll' is situated really in 'c:\tmp' directory, but I get 'java.lang.UnsatisfiedLinkError: no libapr in java.library.path' exception.
    It seems like the already running java program doesn't use actual java.library.path set in previous step.
    Is there any possibility to set java.library.path property in java code?
    Thanx
    Brny

    I think the following code should work:
    // Reset the "sys_paths" field of the ClassLoader to null.
              Class clazz = ClassLoader.class;
              Field field = clazz.getDeclaredField("sys_paths");
              boolean accessible = field.isAccessible();
              if (!accessible)
                   field.setAccessible(true);
              Object original = field.get(clazz);
              // Reset it to null so that whenever "System.loadLibrary" is called, it will be reconstructed with the changed value.
              field.set(clazz, null);
              try {
                   // Change the value and load the library.
                   System.setProperty("java.library.path", "c:\\tmp");
                   System.loadLibrary("libapr");
              finally {
                   //Revert back the changes.
                   field.set(clazz, original);
                   field.setAccessible(accessible);
    The idea is to make the static field "sys_paths" null so that it would construct the paths from the changed value.

  • LoadLibrary doesn't use java.library.path set at runtime

    I'm trying to set the property java.library.path at runtime so I don't have to drop my .dll in the regular system path for a System.loadLibrary to work. This is the sequence I use in a static initilizer:
    System.setProperty("java.library.path", "C:\\");
    System.loadLibrary("DialButton");
    When I put the file DialButton.dll in C:\ I get an java.lang.UnsatisfiedLinkError, but when I put it in D:\WINNT it works fine. I would expect it to do the opposite because presumably I blew away the real java.library.path when I ran setProperty and it shouldn't know to check D:\WINNT.
    I'm trying to keep my application install clean and use a directory structure that maintains all of the required files without cluttering system directories. I also want to dynamically load JNI libraries for a distributed application after copying them to the local machine.
    Thanks in advance,
    Ryan

    In the bug parade I've heard excuses from Sun programmers that this is a read-only property and isn't supposed to be changed. It probably took them longer to write the reply to the bug than it would have to fix the code.
    I looked at the source code for the ClassLoader and for the source release of the JDK 1.3.1 and here's the code I found in the ClassLoader.loadLibrary() method:
            if (sys_paths == null) {
                    usr_paths = initializePath("java.library.path");
                    sys_paths = initializePath("sun.boot.library.path");
            }It seems it parses and caches the system and user library paths on startup and then never bothers to check them to see if they've changed ever again. I think it would be pretty simple to rewrite that code block by moving one line of code down two lines as this:
            if (sys_paths == null) {
                    sys_paths = initializePath("sun.boot.library.path");
            usr_paths = initializePath("java.library.path");I mean, it's not as if loadLibrary is really performance intensive or even critical enough to bother caching at all!
    This one code change could fix a lot of headaches.
    The particular headache I'm working on is that there doesn't seem to be any support in the Servlet 2.2 or 2.3 specification for JNI files. I'd really love to be able to use a directory like WEB-INF\jni to store libraries that need to be distributed with my web application. I tried to dynamically change java.library.path to include WEB-INF\jni, but alas I ran into the same problem you did, it doesn't work.
    Is is possible for this to be fixed, ever? I think it would take longer to say no and make up a reason why not then it would to actually make the fix... seems a good enough arguement to do it to me.
    And alternately, can we come up with a standard place to put JNI stuff for web applications in the next Servlet standards?
    Thanks in advance!
    -J.C.
    [email protected]

  • Problems with java.library.path

    Hi.
    I'm having trouble with the java.library.path setting. Ok, this is the scenario:
    My app is inside a JAR. What I need is to load a native library, and for user convenience I'm putting some common locations manually in java.library.path. Like this:
              // append custom path for the native libraries
              String libraryPath = System.getProperty("java.library.path");
              String sep = System.getProperty("path.separator");
              libraryPath = "." + sep + "libs" + sep + "native" + sep + libraryPath;
              System.setProperty("java.library.path", libraryPath);
              System.out.println(libraryPath);Pretty easy, right? (This is the first thing in my main method). Ok, so I've put the native libraries in the same dir than my JAR. I just do 'java -jar myjar.jar' and my app spits this:
    .:libs:native:/usr/java/jdk1.5.0_06/jre/lib/i386/client:/usr/java/jdk1.5.0_06/jre/lib/i386:/usr/java/jdk1.5.0_06/jre/../lib/i386so my hack is working but... voila! I get UnsatisfiedLinkError.
    What is really annoying and has me out of my mind is the fact that if I run my app as:
    java -Djava.library.path=. -jar myapp.jarit works! If I do this my app prints:
    .:libs:native:.and everything works as expected. What the ff$�(�&$ is going on here??
    Please, help me I'm desperate.
    Thanks

    this one drove me batty for a while too.
    once the library path is set, that's it, playing with it has no effect.
    my solution involved a new instance the VM, something along the lines of:
    String[] C = new String[] { "bash", "-c", "java -Djava.library.path="+libraryPath };
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec( C );
    int eVal = proc.waitFor();
    System.exit( eVal );
    or cmd/command in C[0], /c in C[1] for a M$ system.
    the err and out streams are available using proc.getErrorStream() and proc.getInputStream() as well.

  • What is the Java Library Path?

    Hi,
    I have a Java package that I need to add to my computer. The instillation information that I received with this package is as follows:
    * For this package to function, you must modify your java library path
    (the "java.library.path" property) or you must copy <WInterface.dll> to
    a directory that is already on that path.
    My questions are
    1). What is the java.library.path?
    2). How do I determine what the path is for my computer,
    3). And finally how do I modify this path?
    Thanks for your assistance.

    1) It is the list of paths to search when loading libraries.
    2) That can be found out with this program:public class PrintLibraryPath {
        public static void main(String[] args) {
            System.out.println(System.getProperty("java.library.path"));
    }3) By giving the java launcher the command line argument "-Djava.library.path=yourpath".

  • How do i print out the java.library.path??

    hi, can anyone show me how to print out java.library.path to the terminal? im having unsatisfiedlinkerror problems
    thanks for help in advance
    vanessa

    System.out.println(System.getProperty("java.library.path"));

  • Java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path

    hi,
    i am trying to connect to an oracle 8.1.7 database from my application running on tomcat 4.0.3 / jdk1.4 /windows nt.
    using the thin jdbc-driver (classes12.zip) everything works fine.
    when i try using the oci8-driver, i get an error-message saying:
    java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
    i have the oracle-client installed on my machine.
    the ocijdbc8.dll can be found in D:\server\oracla81\bin
    the environment-variables PATH, CLASSPATH, LD_LIBRARY_PATH (i'm not sure if this has any meaning on nt) all point to this directory.
    i start tomcat using the following option: -Djava.library.path="D:\server\oracla81\bin"
    my application can see this variable:
    System.out.println("java.library.path: "+System.getProperty("java.library.path"));
    prints out the correct value.
    then i try to load the library by myself:
    try {
    System.loadLibrary("ocijdbc8");
    System.out.println("Successfully Loaded");
    } catch(Exception e) {
    System.out.println("LD_LIBRARY_PATH is not properly set");
    e.printStackTrace();
    everything works fine! the library is loaded!
    finally i try to connect to the database and the application throws the mentioned exception:
    lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410)
         at java.lang.Runtime.loadLibrary0(Runtime.java:772)
         at java.lang.System.loadLibrary(System.java:832)
         at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:228)
         at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:249)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    any help would be appreciated.
    thanx in advance,
    frank.
    [email protected]

    It is probably JDK 1.4 that causes the problem. I was able to get strange errors with that version of the JDK with code that worked fine using 1.31.

  • Wrong java.library.path in Netbeans?

    I write some java code and call native method with JNI, it does not work under netbeas, but work well in terminal. I try use System.out.println(System.getProperty("java.library.path")); to know what's wrong, i get two different output:
    netbeans: /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386:
    /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/../lib/i386terminal:
    /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386:
    /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/../lib/i386:/home/ray/Projects/swmse/ext:Yes, the "/home/ray/Projects/swmse/ext" is my defined LD_LIBRARY_PATH, but why cannot Netbeans find it?
    Anybody know this? Thank you!
    My environment JDK 1.5.0.06 + Netbeans 5.5 + Kubuntu 6.06

    I've had a similar problem (or the same). At last my mistake was give "bad" names to my libraries.
    Note the importance of the java line:
    System.loadLibrary("nameiwant");
    when compiling your .c program it will be:
    ..... -o libnameiwant.so .... ( i.e. "lib"+"nameiwant"+".so" )

  • Mac OS X 10.4.x and error no ocijdbc10 in java.library.path

    Hi all,
    I installed Oracle Instant Client 10.1.0.3 on my Mac OS X 10.4 (PPC). I stored this client into path /usr/local/oracle/instantclient10_1. I set all properties as PATH, ORACLE_HOME, DYLD_LIBRARY_PATH, etc...
    export set ORACLE_HOME=/usr/local/oracle/instantclient10_1
    export set DYLD_LIBRARY_PATH=$ORACLE_HOME
    export set LD_LIBRARY_PATH=$ORACLE_HOME
    export set SQLPATH=$ORACLE_HOME
    export set TNS_ADMIN=$ORACLE_HOME
    export set PATH=$PATH:$ORACLE_HOME
    When I use SQLPLUS all work correctly but when I use JDBC OCI driver I got error no ocijdbc10 in java.library.path. But when I show system property java.library.path I can see this: java.library.path ==> /usr/local/oracle/instantclient10_1:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    Can you somebody help with it. Thanx
    Edited by: user2258172 on 4.6.2009 7:21

    I am not familiar with Mac OS, but there are two things I can think of that you can check:
    - This is trivial, and you probably did that: ist libocijdbc10.dylib in /usr/local/oracle/instantclient10_1 ?
    - Could it be that Java is 32-bit and libocijdbc10.dylib is 64-bit or vice versa?
    Yours,
    Laurenz Albe

  • UnsatisfiedLinkError: no db_java-4.4 in java.library.path

    I am stumped. I have the appropriate libraries in /usr/lib, and when I run this from the command line, it works fine. When I run the application through the Sun One server however, it comes up with the "UnsatisfiedLinkError: no db_java-4.4 in java.library.path". I have put /usr/lib into the server console library locations, and I have no idea why I cannot get this to work. Anyone have any suggestions? I would be forever grateful :)

    Maybe this helps:
    http://forum.java.sun.com/thread.jspa?threadID=570172
    Or, as suggested, LD_LIBRARY_PATH.
    mludwig@forelle:~/Werkstatt/java > cat JavaLibraryPath.java
    public class JavaLibraryPath {
        public static void main( String args[]) {
            String jlp = System.getProperty( "java.library.path");
            System.out.println( jlp.replace( ':', '\n'));
    mludwig@forelle:~/Werkstatt/java > javac JavaLibraryPath.java
    mludwig@forelle:~/Werkstatt/java > java JavaLibraryPath
    /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/i386/server
    /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/i386
    /usr/lib/jvm/java-6-sun-1.6.0.00/jre/../lib/i386
    /usr/java/packages/lib/i386
    /lib
    /usr/lib
    mludwig@forelle:~/Werkstatt/java > LD_LIBRARY_PATH=/usr/local/dbxml-2.4.13/lib java JavaLibraryPath
    /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/i386/server
    /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/i386
    /usr/lib/jvm/java-6-sun-1.6.0.00/jre/../lib/i386
    /usr/local/dbxml-2.4.13/lib    <-- works (on my Linux, at least)
    /usr/java/packages/lib/i386
    /lib
    /usr/libMichael Ludwig

  • Error with System.loadLibrary(...) with java.library.path set

    I'm trying to get my feet wet with JavaMonkeyEngine using netbeans (on Windows XP SP3, Java 1.6).
    When I try to run a simple example program, I'm getting
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl.dll in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
    My runtime arguments include: -Djava.library.path="../../../../../projectSupport/jME2/lib/lib/lwjgl/native/windows/:etc
    I'm pretty sure that the path is correct, because I tried the following code:
    String [] dirs = System.getProperties().getProperty("java.library.path").split(":");
    for(int i = 0; i < dirs.length; i++ ){
    String path = dirs[i] + java.io.File.separatorChar + "lwjgl.dll";
    if( (new java.io.File(path)).exists()) {
    System.out.println("found in dir " + dirs);
    path = (new java.io.File(path)).getAbsolutePath();
    System.load(path);
    System.out.println("was able to load library manually");
    and the System.load method was reached and didn't throw an exception.
    However, the below call does throw an exception.
    System.loadLibrary("lwjgl.dll");
    Presumably, I shouldn't need to put the dlls into my Path (otherwise whats the purpose of the -D argument).
    I would appreciate some brilliant illuminating thought about now, something like "you forgot the magical snafu parameter" or such.
    Thanks in advance.
    Eric.

    My runtime arguments include:
    -Djava.library.path="../../../../../projectSupport/jME2/lib/lib/lwjgl/native/windows/:{code}So, you're on a Windows OS, and looking for a Windows DLL?
    I'm pretty sure that the path is correct, because I tried the following code:
    {code}String [] dirs = System.getProperties().getProperty("java.library.path").split(":");{code}So, you're specifying a path using the UNIX separator ':', instead of the Windows one ';'?
    Your test code has the knowledge to parse a LINUX-like path, but the Windows VM doesn't have this knowledge (I admit the misleading part is that the VM generally accepts '/' as a file separator (instead of the Windows-standard '\' one), but doesn't recognize the ':' separator). Try using ';' to separate multiple pathes in your command line:
    {code}-Djava.library.path="../../../../../projectSupport/jME2/lib/lib/lwjgl/native/windows/;<noticeTheSeparators>;...    J.
    Edited by: jduprez on Jan 12, 2010 1:39 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • No jacob in java.library.path.doc

    I am running Developer Suite 10g on Windows XP. I have the OC4J instance running. I am using WebUtil and trying to use the OLE2 stuff. When I execute the code, nothing happens (see errors below) – except all my buttons go dead. I checked, and it does not seem that I am getting the Jacob, JNIsharedstubs, and the d2kwut60 DLLs to download to my Jinitiator directory. I removed and reinstalled Jinitiator, but still nothing. If I manually copy the DLLs to the directory, I at least begin to get OLE2 errors. I read the message board (and modified “Word.Basic” to “Word.Application”) and read the WebUtil manual and reviewed my set-up. Any suggestions are much appreciated.
    Java console:
    Oracle JInitiator: Version 1.3.1.17
    Using JRE version 1.3.1.17-internal Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\don4
    Proxy Configuration: Automatic Proxy Configuration
    JAR cache enabled
    Location: C:\Documents and Settings\don4\Oracle Jar Cache
    Maximum size: 50 MB
    Compression level: 0
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    Downloading http://d26.corp.don.com:8889/forms90/java/f90all_jinit.jar to JAR cache
    Downloading http://d26.corp.don.com:8889/forms90/webutil/webutil.jar to JAR cache
    RegisterWebUtil - Loading Webutil Version 1.0.2 Beta
    Downloading http://d26.corp.don.com:8889/forms90/webutil/jacob.jar to JAR cache
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 9.0.4.0
    2004-Jun-18 14:33:28.903 WUI[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:28.953 WUF[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:28.983 WUH[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:29.13 WUS[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:29.53 WUT[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:29.214 WUO[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:29.254 WUL[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:29.284 WUB[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Jun-18 14:33:34.745 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.jacob.dll
    2004-Jun-18 14:33:34.785 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
    2004-Jun-18 14:33:34.815 WUT[loadSettings()] Local properties file loaded
    2004-Jun-18 14:33:34.855 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.JNIsharedstubs.dll
    2004-Jun-18 14:33:34.895 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
    2004-Jun-18 14:33:34.926 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.d2kwut60.dll
    2004-Jun-18 14:33:34.976 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
    2004-Jun-18 14:33:49.722 WUF[setProperty()] Setting property WUF_FILENAME to C:\temp
    2004-Jun-18 14:33:49.722 WUF[setProperty()] Setting property WUF_FILE_ATTRIBUTE to 1
    2004-Jun-18 14:33:49.722 WUF[getProperty()] Getting property WUF_FILE_ATTRIBUTE
    2004-Jun-18 14:33:49.742 WUF[setProperty()] Setting property WUF_FILENAME to C:\temp
    2004-Jun-18 14:33:49.742 WUF[setProperty()] Setting property WUF_FILE_ATTRIBUTE to 4
    2004-Jun-18 14:33:49.742 WUF[getProperty()] Getting property WUF_FILE_ATTRIBUTE
    2004-Jun-18 14:33:49.752 WUF[setProperty()] Setting property WUF_GFN_DIRNAME to C:\temp
    2004-Jun-18 14:33:49.772 WUF[setProperty()] Setting property WUF_FILENAME to *.csv
    2004-Jun-18 14:33:49.772 WUF[setProperty()] Setting property WUF_FILTER to All CSV Files (*.csv)|*.csv|
    2004-Jun-18 14:33:49.792 WUF[setProperty()] Setting property WUF_GFN_MESSAGE to Open Interface Import File
    2004-Jun-18 14:33:49.822 WUF[setProperty()] Setting property WUF_GFN_MULTISELECT to FALSE
    2004-Jun-18 14:33:49.822 WUF[getProperty()] Getting property WUF_GFN_OPENFILE
    2004-Jun-18 14:33:52.904 WUF[setProperty()] Setting property WUF_FILENAME to false
    2004-Jun-18 14:33:52.904 WUF[setProperty()] Setting property WUF_FILE_ATTRIBUTE to 4
    2004-Jun-18 14:33:52.904 WUF[getProperty()] Getting property WUF_FILE_ATTRIBUTE
    2004-Jun-18 14:33:52.914 WUF[setProperty()] Setting property WUF_FILENAME to false
    2004-Jun-18 14:33:52.914 WUF[setProperty()] Setting property WUF_FILE_ATTRIBUTE to 1
    2004-Jun-18 14:33:52.914 WUF[getProperty()] Getting property WUF_FILE_ATTRIBUTE
    2004-Jun-18 14:33:52.924 WUF[setProperty()] Setting property WUF_FILENAME to false
    2004-Jun-18 14:33:52.924 WUF[setProperty()] Setting property WUF_FILE_ATTRIBUTE to 2
    2004-Jun-18 14:33:52.934 WUF[getProperty()] Getting property WUF_FILE_ATTRIBUTE
    2004-Jun-18 14:34:00.212 WUO[setProperty()] Setting property WUO_OLE2_OBJNAME to WORD.Basic
    2004-Jun-18 14:34:00.222 WUO[getProperty()] Getting property WUO_OLE2_CREATE_OBJ
    Exception occurred during event dispatching:
    java.lang.UnsatisfiedLinkError: no jacob in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.jacob.com.Dispatch.<clinit>(Dispatch.java)
    at oracle.forms.webutil.ole.OleFunctions.create_obj(OleFunctions.java:513)
    at oracle.forms.webutil.ole.OleFunctions.getProperty(OleFunctions.java:218)
    at oracle.forms.handler.UICommon.onGet(Unknown Source)
    at oracle.forms.engine.Runform.onGetHandler(Unknown Source)
    at oracle.forms.engine.Runform.processMessage(Unknown Source)
    at oracle.forms.engine.Runform.processSet(Unknown Source)
    at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
    at oracle.forms.engine.Runform.onMessage(Unknown Source)
    at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
    at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
    at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    J:\WebUtil\server\WebUtil.cfg file contains:
    install.syslib.location=http://d26.corp.don.com:8889/forms90/webutil
    install.syslib.0.7.1=jacob.dll|94208|1.0|true
    install.syslib.0.9.1=JNIsharedstubs.dll|65582|1.0|true
    install.syslib.0.9.2=d2kwut60.dll|192512|1.0|true
    C:\Oracle\10iDS2\forms90\server\default.env contains:
    ORACLE_HOME=c:\oracle\10iDS2
    FORMS90_PATH=c:\oracle\10iDS2\cgenf61\admin;c:\oracle\10iDS2\forms90;c:\ipms\forms10g;j:\WebUtil\forms;j:\WebUtil\lib;j:\bin10g
    PATH=c:\oracle\10iDS2\bin;c:\oracle\10iDS2\jdk\jre\bin\client
    FORMS90=c:\oracle\10iDS2\forms90
    WEBUTIL_CONFIG=j:\webutil\server\webutil.cfg
    CLASSPATH=j:\webutil\lib\webutil.jar;j:\webutil\lib\jacob.jar;c:\oracle\10iDS2\jdk\jre\lib\rt.jar;c:\oracle\10iDS2\j2ee\forms90app\forms90web\WEB-INF\lib\f90srv.jar;c:\oracle\10iDS2\jlib\repository.jar;c:\oracle\10iDS2\jlib\ldapjclnt9.jar;c:\oracle\10iDS2\jlib\debugger.jar;c:\oracle\10iDS2\jlib\ewt3.jar;c:\oracle\10iDS2\jlib\share.jar;c:\oracle\10iDS2\jlib\utj90.jar;c:\oracle\10iDS2\jlib\zrclient.jar;c:\oracle\10iDS2\reports\jlib\rwrun.jar;C:\Oracle\10iDS2\jdk\jre\bin\client\jvm.dll
    Orion-web.xml contains:
    <virtual-directory virtual-path="/webutil" real-path="j:\webutil\lib" />
    Forms90.conf contains:
    # Virtual path for webutil
    AliasMatch ^/forms90/webutil/(..*) "j:\webutil\lib/$1"
    Formsweb.cfg has all changes in one named section:
    [webutil]
    pageTitle=Oracle9iAS Forms Services - WebUtil
    webUtilArchive=/forms90/webutil/webutil.jar,/forms90/webutil/jacob.jar
    WebUtilLogging=all
    WebUtilLoggingDetail=detail
    WebUtilErrorMode=Alert
    baseHTMLjinitiator=j:\webutil\server\webutiljini.htm

    >
    Orion-web.xml contains:
    <virtual-directory virtual-path="/webutil"
    real-path="j:\webutil\lib" />
    Forms90.conf contains:
    # Virtual path for webutil
    AliasMatch ^/forms90/webutil/(..*)
    "j:\webutil\lib/$1"
    I'm not sure about 10G, but for 9ids this is definitely wrong (see famous page 6 of 49 WebUtil Manual). On 9ids you have to add the virtual directory in orion-web.xml only, not in forms90.conf. On 9ias it is vice verca.
    Hope this helps
    Gerald

Maybe you are looking for

  • How can i make my officejet 6500a print in black and white only?

    I just bought an officejet 6500a and I can't figure out how to make it print in black in white only.  I print a lot of stuff that doesn't need color and want to save my ink. On some prints it gives me that option when I print. but for the most part i

  • Ipod shuffle with permanently attached cable?

    I got this shuffle from a friend (im not sure what gen) and it has a cable attached to it that cannot be pulled out. the end of the cable has the connector to plug it into the bottom of an ipod or iphone... I don't see the point in this cable because

  • Re-installing iPhoto '08 after "fresh" Snow Leopard install.

    Sorry if I'm beating a dead horse here, but I keep seeing conflicting info on whether or not one can, or should, do a drag-drop of iPhoto from one volume to another. Here's my story: I had an older version of iPhoto on my iMac. I bought a MacBook in

  • Why doesn't Firefox keep the tabs in the way it is supposed to do?

    I have been using Firefox for a long time and know my way round it. In recent times it simply refuses to restore open tabs. On the internet help files it merely states the obvious regarding settings. I know all this basic stuff. I have reset the brow

  • Accessing an ejb from a servlet gives resource not allowed exception

    hi friends, i deployed a bean in weblogic server calling from within a servlet. this bean is used to retrieve a database connection and returns to the servlet. i have done all the resource references lookups everything and also the bean is deployed s