Meaning of java.library.path and UnsatisfiedLinkError

I'm trying to compile and run a simple program that uses a jar extension called "*jnetpcap*". I compile it (with classpath), then run it with:
java -classpath /usr/share/java/jnetpcap.jar:./ <ClassFileName>
When I do this I get :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnetpcap in java.library.path
*...What's that all about ?*

Some Java libraries are written partly in native code (usually written in C++). The native code is placed in a shared library, which is a .dll on Windows, or a .so on unix. java.library.path is the system property which tells the JVM which directories to search for these shared libraries. I suggest you look for a jnetpcap.so. If you find it try the command line option -Djava.library.path=/netpcap/lib (giving the directory containing the .so file).

Similar Messages

  • Help: java.library.path and javah

    Hello,
    I have a little problem with my java.library.path!
    I am working on a program which loads a dll in c++ that I have compiled
    and will be used by a java program.
    My java program consists of 2 Classes:
    -- MonitorContainer.class creates an object; this object has an attribute which is a String type and it should be communicating with my dll: Diskid32.dll
    -- This dll is loaded by another class : Diskid32.class with a known
    and documented method: System.loadLibrary("Diskid32").
    When all the following files(MonitorContainer.class, Diskid32.class, Diskid32.dll) are in the same folder, the program works fine
    I need to put the Diskid32.dll and the Diskid32.class into a package! (package myutil.Disk)
    I have two questions concerning the javah tool:
    -- when I when I create the signatures with javah should I run:
    ------ javah Diskid32 or something else like
    ------ javah util.Disk.Diskid32 or ...
    I have tried both of these and they produce header files which are different and both produce the same result in execution error
    when I run my program and it's package
    -- I tried to configure the java.library.path but still no go! When I launch java MonitorContainer I receive the following wrong message :
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no Diskid32 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1344)
    at java.lang.Runtime.loadLibrary0(Runtime.java:744)
    at java.lang.System.loadLibrary(System.java:815)
    at myutil.Disk.Diskid32.<clinit>(Diskid32.java:52)
    at MonitorContainer.main(MonitorContainer.java:21)
    My conclusion is that library path is not well configured
    and the JVM is not finding my library diskid32.dll.
    Thank for all...
    Stephane

    Hello,
    I 've solve my problem: to set the library path You must write :
    java -Djava.library.path=c:/xxx/yyy/zzz ; c:/xxx/yyy/zzz is the path to locate the Dll!
    But the really problem was a forgetting in the c++ code, I have write a mistake in the line that references � class!
    (jclass cls = env->FindClass(".../.../...");)
    Thank for all

  • Windows too - java.lang.UnsatisfiedLinkError: no cis in java.library.path

    There have been many posts of people who get the following exception:
    java.lang.UnsatisfiedLinkError: no cis in java.library.path
    And it is always on solaris only, they don't seem to get it on windows. However, I AM using windows and am getting this error trying to run a simple stand alone java app to connect to a jms topic. I'm trying to connect like so:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");     
    env.put(Context.PROVIDER_URL, "iiop://localhost:3700");
    jndiContext = new InitialContext(env);
    Thus far I have been COMPLETELY unable to get a simple little standalone java app to connect to a jms topic on the sun server. Why is this so @#%$#@ hard? Anyway, even though it compiles file, I get the above exception when I try. I imagine it's a environment varaible/classpath issue. Soooo, can someone please give me the complete list of all required jar/dll files which must be in the classpath, as well as all environment variables which must be set in order to get a simple java app to connect to a jms topic? Please? Thank you.
    Tony

    Sorry, but I have those .dll files in my classpath. Here is the batch file I'm using to try to run my simple standalone app (called SimpleTopicPublisher):
    cls
    setlocal
    set JAVA_HOME=C:\sun\AppServer7\jdk
    set ANT_HOME=C:\prog\java\BOABackOffice\3rdparty\ant
    set IMQ_HOME=C:\sun\AppServer7\imq
    set classpath=.;
    set classpath=%classpath%;C:\prog\java\BOABackOffice\3rdparty\junit\junit.jar
    set classpath=%classpath%;C:\sun\AppServer7\imq\lib\jms.jar;C:\sun\AppServer7\imq\lib\imq.jar;C:\sun\AppServer7\imq\lib\fscontext.jar
    set classpath=%classpath%;C:\sun\AppServer7\lib\appserv-ext.jar;C:\sun\AppServer7\lib\appserv-rt.jar;C:\sun\AppServer7\lib\appserv-admin.jar
    set classpath=%classpath%;C:\sun\AppServer7\bin\cis.dll;C:\sun\AppServer7\bin\libnspr4.dll;C:\sun\AppServer7\bin\libplc4.dll
    set classpath=%classpath%;C:\sun\AppServer7\bin\libplds4.dll;C:\sun\AppServer7\bin\nss3.dll;C:\sun\AppServer7\bin\ssl3.dll
    set path=%path%;%JAVA_HOME%\bin;%ANT_HOME%\bin
    java SimpleTopicPublisher com.ecc.utils.LoggerTopic 1
    endlocal
    I have all the .dll's in my classpath, as well as .jar files that I can think of. Still no luck.
    - Tony

  • Library paths and environment variables

    Hello,
    I am using 10g AS 9.0.4 on a Unix system.
    I am trying to convert an old JSP web application to work with 10g. It is not an EAR/WAR file so I am manually trying to set it up under the "default-web-app" folder. It uses a number of java class files which currently reside in $J2EE_HOME/default-web-app/WEB-INF/classes/mystuff.
    These class files require access to a number of libraries. I foolishly believed that they would be accessible if I were to place them in the $J2EE_HOME/default-web-app/WEB-INF/lib folder, but that did not work.
    I read that OC4J uses a "catch all" lib directory at $J2EE_HOME/applib. I copied the library files there and they still did not work.
    Frustrated, I tried to print out the environment variables for the server - only to find that this function is not supported.
    I managed to print out the library path by creating a Java class files which returns the following as a string:
    System.getProperty("java.library.path");
    This (when called from a JSP) prints a number of different library paths, none of which match those found listed in the $J2EE_HOME/config/application.xml file. I placed the library files in one of the paths listed by the "java.library.path" and it worked!
    3 questions:
    1. How do you print the server's environment variables using a JSP? This strikes me as a very useful function for sorting out library and path issues. Do a search on Google for "print environment variables OC4J" or something similar and there are no useful pages suggesting how this can be done.
    2. Why are the default library paths different on the server than to those specified in application.xml?
    3. How do I change the LD_LIBRARY_PATH (or any environment variable for that matter)? I have tried adding the following line to $ORACLE_HOME/Apache/Jserv/etc/jserv.properties without success:
    wrapper.env=LD_LIBRARY_PATH=/my/custom/library/path
    Any help you can offer would be most appreciated.

    >
    Thanks very much for a such a comprehensive response
    - it has helped answer a lot of questions, especially
    being able to print out the system properties. That
    will be really useful!
    No worries at all Rob.
    The main hurdle is that the libraries are indeed
    native (*.so) libraries. I hadn't considered that
    until you pointed it out in your message. Can I
    assume, then, that $J2EE_HOME/applib and
    $J2EE_HOME/default-web-app/WEB-INF/lib are only
    designed to handle Java's .JAR librares? That would
    explain why placing the native libraries in there
    didn't work, but is there a way of getting such
    native libraries recognised and bundled up in a
    WAR/EAR file?
    Yep, that's it.
    Our proprietary applib and the servlet specs web-inf/lib are only dealing with Java archives.
    The J2EE specs don't cover how to deal with native libs like this.
    Now I've NEVER EVER tried it, but it's worth a shot of at least trying -- for simplified packaging purposes, what you may be able to do is to distribute the .so's within the web-inf/lib -- and then just set that directory (where's its realized on the server after the app is deployed) to be referenced witihn the LD_LIBRARY_PATH. I'd expect our deployment manager will just ignore files it doesn't know about, so arguably you should be able to at least distribute them with the standard archive.
    You'll need to specifically set the LD_LIBRARY_PATH as a separate task outside of the deployment operation though.
    >
    This is where things get a bit weird, and is partly
    my fault during the installation of 10g AS.
    We already had an existing installation of Oracle 10g
    Database (10.1.0) at $ORACLE_HOME under the user
    "oracle". I logged in as the user "oracle" to install
    the Application Server into a different location (In
    this case, "$ORACLE_HOME/../ias10g_9.0.4" - let's
    call this $IAS_HOME). So there is no separate user
    account for Oracle Database and Application Server
    (and hence no separate $LD_LIBRARY_PATH).
    If I log into UNIX as the user "oracle" and echo the
    LD_LIBRARY_PATH, I get the following directories:
    $ORACLE_HOME/lib
    /usr/openv/netbackup/bin
    /usr/dt/lib
    /usr/lib
    I use this user to do "opmnctl stopall" and "opmnctl
    startall". If I then print out the library path from
    a JSP using
    "System.getProperty("java.library.path");", I get the
    following paths:
    $IAS_HOME/jdk/jre/lib/sparc/server
    $IAS_HOME/jdk/jre/lib/sparc
    $IAS_HOME/jdk/jre/../lib/sparc
    $IAS_HOME/opmn/lib
    $IAS_HOME/lib
    $IAS_HOME/usr/lib
    Which is totally different to those listed by
    $LD_LIBRARY_PATH at the command line, which means
    they must be coming from somewhere else.
    It gets worse - my application is trying to call a
    native library that is only present in the
    $ORACLE_HOME/lib32 directory (libclntsh.so.10.1), so
    unless I can include this path in the
    "java.library.path" on the Applicaiton Server, then
    my program will not work.
    So, how do I change the "java.library.path" when the
    values aren't coming from $LD_LIBRARY_PATH in the
    first place?
    The utility $IAS_HOME/opmn/bin/opmnctl is actually a shell script.
    It has this section which sets the LD_LIBRARY_PATH:
    if [ -z "$LD_LIBRARY_PATH" ]
    then
    LD_LIBRARY_PATH=$ORACLE_HOME/opmn/lib:$ORACLE_HOME/lib ; export LD_LIBRARY_PATH
    else LD_LIBRARY_PATH=$ORACLE_HOME/opmn/lib:$ORACLE_HOME/lib:${LD_LIBRARY_PATH} ; export LD_LIBRARY_PATH
    fi
    So if you have an existing LD_LIBRARY_PATH env var set, it should just be putting its paths onto the front of it.
    What you could try as a quick test is to edit the opmnctl script (after taking a backup of course) and either appending the path you need to it, or just add some debug statements to output the LD_LIBRARY_PATH value it ends up setting so you can try and work out what's causing it.
    I expect these other entries:
    $IAS_HOME/jdk/jre/lib/sparc/server
    $IAS_HOME/jdk/jre/lib/sparc
    $IAS_HOME/jdk/jre/../lib/sparc
    are coming from the JRE when it is launched, in probably a similar manner to our opmn entries.
    I really appreciate your help, and I bet if anyone
    can answer these questions, you can! ;-)
    You're very welcome.
    cheers
    -steve-

  • 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!!

  • SQL Developer Not Working "no ocijdbc11 in java.library.path"

    Hi,
    I have Oracle 10g with SQL Developer 3.0 on Windows XP, they worked well untill I just installed Oracle ODBC (ODAC101040.exe). I started to receive error message "no ocijdbc11 in java.library.path" and I am no longer able to use SQL Developer.
    Any solution?

    Check on the envirnment variables on the windows. Once you installed the "Oracle ODBC" it might have replaced the Old env. variables that can found in XP "System Properties> advance tab> environment Variables". Make sure you have the right environment variables that point to right directory locations. Update us with your findings.

  • UnsatisfiedLinkError: and no oraInstaller in java.library.path

    hitting below error for : opatch lsinventory
    UnsatisfiedLinkError: and no oraInstaller in java.library.path
    Can any one please help?
    Regards
    S

    Hi Helio,
    thanks for the response:
    This is a unix specific issue. The most frequent reason for this is the liboraInstaller shared object file (liboraInstaller.so/sl) cannot be located at run time. The extension is ".so" for most systems, ".sl" for most other systems(usually HP) .
    -- liboraInstaller.so file exists with .so ext
    It means LD_LIBRARY_PATH (or SHLIB_PATH, LIBPATH, DYLD_LIBRARY_PATH or it's equivalent)doesn't include a path to liboraInstaller file.
    -- can you please specify what the exact path should be for $LD_LIBRARY_PATH
    The file is located under the "oui" hierarchy (normally under $ORACLE_BASE/oui/bin/<plaform name>, like oui/bin/solaris). The "oui" directory should be in the same directory as the oraInventory directory that is pointed to by the oraInst.loc file.
    -- oui and oraInventory are under the same directory $ORACLE_HOME.
    Regards
    S

  • UnsatisfiedLinkError and java.library.path?

    I did look for this topic in this forum. The question has been asked, but I don't see an answer :(
    I get an error at runtime...
    "java.lang.UnsatisfiedLinkError: no EZTaxJavaCpp.dll in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)"
    Code...
    public class EZTaxJNI {
    private native void sendEZCmd(String cmd);
    static{
    System.loadLibrary("EZTaxJavaCpp.dll");
    public static void main(String[] args) {
    EZTaxJNI ez = new EZTaxJNI();
    ez.sendEZCmd("control initialize");
    System.out.println("JNI");
    The dll exists. I tried adding the path with the dll name and it didn't work. I tried removing the .dll extention and no luck. Where do I set java.library.path?

    regarding the dll not found :
    - if you state System.loadLibrary(...) you need to put the dll into a system library (like system32)
    - if you state System.load(....) you can/must specify the complete path to your dll
    regarding the UnsatisfiedLinkError :
    three reasons I can think of :
    - if your java module belongs to a package, i.e. if you have a statement like
    package com.hllapi;
    in your code, then you need to state this in the native code like this
    JNIEXPORT jstring JNICALL Java_com_hllapi_JRmmApi_runCommand (JNIEnv *env, jobject obj, jstring cmd)  
    - something in the header file is wrong ?
    I usually have the 'extern "C" .....' statement in the header file,
    but I guess your way should work as well
    - finally, I just realized, that you have two underscores in your statement after 'Java'
    -> Java__EZTaxJNI_sendEZCmd(JNIEnv* env, jobject, jstring jMsg
    this might be a problem
    Hope this helps....

  • 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.

  • Oracle Calendar - UnsatisfiedLinkError: no csdkjni in java.library.path

    Hi, all.
    I deployed my test calendar application developed using Jdeveloper 10.1.3.0 (on Windows XP) to the Oracle 10.1.3. AS on a linux server, but the CalendarServer in on another installation (Collaboration Suite 10.1.2) on the same linux server.
    When I try to executed the code that calls the calendar server I get this error:
    500 Internal Server Error
    javax.faces.el.EvaluationException: java.lang.UnsatisfiedLinkError: no csdkjni in java.library.path
    I set the LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/ocal/lib on the collaboration suite 10.1.2 installation.
    When I try to run the code on my Jdeveloper I get the same error:
    java.lang.UnsatisfiedLinkError: no csdkjni in java.library.path
    In my windows machine I create a folder where I put the dll's and jar files that came from the collaboration suite windows installation, but I get always the same error
    This is the code:
    try
    Api.init("calendar.ini", "calendar.log");
    catch(Api.StatusException e)
    System.out.println("init returned status'" + e.getMessage() + "'");
    System.exit (1);
    Is my approach correct? Because if i'm developing on Windows and I need dll's files to connect to the calendar server on linux, but when I deploy the application to the linux server those dll's are useless and cannot be used. So am I missing something here? Do I need anything else to get this to work?
    Best Regards,
    Rui

    1. Use 1 and only 1 of classes12.zip and ojbc14.jar; they have different versions of the same classes in them.
    2. The Oracle OCI driver for JDBC uses .dll files or .so files from the Oracle client installation (as well as Oracle network configuration files, I think); most people use the thin driver instead to avoid this problem.
    To use the thin driver, change your url, see here for details:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_00
    To stay with the OCI driver (not recommended), you need to have the appropriate Oracle client installation (or at least get the dlls or sos), and I think set additional environment variables, such as ORACLE_HOME and possibly LD_LIBRARY_PATH. I don't do this myself, so I can't give much more advice.

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

    Hi,
    I'm using Java 1.5 with Oracle 10g on a Mac 10.5.6 and trying to use the OCI cilent. Sadly, I'm getting the following error
    Caused by: java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1753)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:993)
    at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3147)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3143)
    at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
    at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132) at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    at com.caucho.sql.DriverConfig.createDriverConnection(DriverConfig.java:567)
    at com.caucho.sql.ManagedConnectionImpl.initDriverConnection(ManagedConnectionImpl.java:242) at com.caucho.sql.ManagedConnectionImpl.<init>(ManagedConnectionImpl.java:131)
    at com.caucho.sql.ManagedFactoryImpl.createManagedConnection(ManagedFactoryImpl.java:121) at com.caucho.jca.ConnectionPool.create(ConnectionPool.java:792)
    at com.caucho.jca.ConnectionPool.allocatePool(ConnectionPool.java:661) at com.caucho.jca.ConnectionPool.allocate(ConnectionPool.java:620)
    ... 23 more
    My database connection string is
    jdbc:oracle:oci:@test-database:1521:orcl11
    I am using a Resin 3.0.19 app server, and the java.library.path I set it to is /opt/oracle:/opt/oracle/lib. Here are the contents of those directories
    /opt/oracle:
    bin     lib     network     ord     sqlj
    /opt/oracle/lib
    README_IC.htm          libheteroxa10.dylib     libocijdbc10.dylib     orai18n.jar
    classes12.jar          libnnz10.dylib          libsqlplus.dylib     sqlplus
    glogin.sql          libocci.dylib.10.1     ocrs12.jar
    libclntsh.dylib.10.1     libociei.dylib          ojdbc14.jar
    Any ideas for further troubleshooting? Thanks, - Dave

    The oci library must be in the shared library path of the platform. Simple as that.
    Do you have that library(ocijdbc10) installed? On platforms besides MAC a client install of the Oracle GUI allows for it.

  • 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....:)

  • UnsatisfiedLinkError: no awt in java.library.path

    Hi all,
    UnsatisfiedLinkError: no awt in java.library.path
    I get the above error when I try to start either the WebLogic server
    or the Console from the command line. I'm using JDK1.2 on Solaris 2.6
    with the WebLogic Server 4.5.1 evaluation program. The error leads me to
    believe that the JDK_HOME property is not correctly set. ALL info on the
    site pertaining to the JDK_HOME property applies to Windows, and I have
    not seen anything about this property in a Solaris environment.
    Currently my JDK_HOME property points to the directory where all of the
    binaries are located, rather than where the rte.jar file is located.
    Can anyone who has successfully run the evaluation on Solaris with
    JDK 1.2 give some pointers as to how your environment settings are set?
    Thanks!
    BP

    Hi Brian,
    Your JDK_HOME should point to your java directory, NOT to the bin directory.
    Your PATH however should have the bin directory appended to it if you want
    to be able to run java without having to explicitly specify its full path.
    Brian Ploetz <[email protected]> wrote in message
    news:[email protected]..
    Hi all,
    UnsatisfiedLinkError: no awt in java.library.path
    I get the above error when I try to start either the WebLogic server
    or the Console from the command line. I'm using JDK1.2 on Solaris 2.6
    with the WebLogic Server 4.5.1 evaluation program. The error leads me to
    believe that the JDK_HOME property is not correctly set. ALL info on the
    site pertaining to the JDK_HOME property applies to Windows, and I have
    not seen anything about this property in a Solaris environment.
    Currently my JDK_HOME property points to the directory where all of the
    binaries are located, rather than where the rte.jar file is located.
    Can anyone who has successfully run the evaluation on Solaris with
    JDK 1.2 give some pointers as to how your environment settings are set?
    Thanks!
    BP

  • UnsatisfiedLinkError: no ocijdbc8 in java.library.path

    In case any of you have gotten this error (I've seen a lot of posts in reference to it) and are using Windows Apache Jserv..... make sure to update your jserv.properties's wrapper.path property with the path to your OCIJDBC8.DLL.
    Here is the error log from my mod_jserv.log file:
    [26/07/2000 00:08:12:433] (ERROR) ajp12: Servlet Error: java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path: no ocijdbc8 in java.library.path
    so if you've got similar problems and already have ocijdbc8.dll in your WINDOWS path.. remember that JSERV requires it in ITS OWN PATH property.
    Just trying to be helpfull :^)
    Moran Ben-David
    [email protected]

    are you able to run jdbc programs from javac?

  • UnsatisfiedLinkError: no njssl10 in java.library.path

    Hello everyone,
    Currently I'd like to use a web service which is secured by https within JDeveloper 10.1.3. Therefore I've created a web service proxy for calling the web service.
    Unfortunately running my application and trying to call the web service results in the following error message:
    java.lang.UnsatisfiedLinkError: no njssl10 in java.library.path
    I've already tried to use the standard Sun J2SE, instead of the build-in J2SE, but this didn't provide a solution.
    What can I do to make the system find the njssl10?
    Thanks in advance!

    "http://forums.oracle.com/forums/message.jspa?messageID=955189" didn't solve the issue (in this situation), as I also already tried changing libraries and using the JSSE environment from Sun.
    The strange thing however is that when I start the HTTP analyzer the problem doesn't occur (although I then end up with a "400 Bad Request"). Even though I don't use the HTTP analyzer as a proxy or something, and my code also doesn't refer to localhost so it doesn't use the HTTP analyzer at all. Isn't this strange?

Maybe you are looking for

  • Satellite M30-951 graphic card or video BIOS does not work properly

    On the BIOS and boot pages strange characters occur (screenshot www.audioberlin.com/M30-951_SCREEN.jpg). XP boots up but the elements displayed freeze and the display becomes black for a second. The system becomes slow and does not react any longer.

  • Migrating from 5 to 6i to 10g

    Hi I'm migrating form and reports from 5 to 10g. Before this i compiled all the files in oralce forms 6i. Its working fine in forms 6i. When i compiled in the devsuite 10g it doesn't given any error.But LOV's are not working. Suppose if i press F9 on

  • Update asset master record serial number when doing GR

    Hi, The client has a requirement to update the serial# on an asset master record when the user process goods receipt through MIGO. Is there a BADI or another functionality that we can use to update the serial# on an asset master record upon GR? Thank

  • AIP-51505: 5084: XEngine error - Invalid data.

    Hi All, I am getting invalid data error when posting a EDI 855 from BPEL to iB2B. I have done the following already: set validation to false and verified the XML against the xsd using XMLSpy. Any idea what can be wrong? Thanks in advance, Suresh 2007

  • Refurbishment settlement to material

    Hi Experts, I have done a Refurbishment process cycle for a material with condition based valuation type(DEF type to REP type) and I have done TECO. Stock quantity is getting updated when I do GR (IW8W). But the Moving average price remains the same