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....:)
Similar Messages
-
Hi,
After ORACLE 11G software installation i tried to change the ORACLE_HOME directory.
OS : RHEL 4.5
DB : 11.2.0
Previous Home Location :
[oracle@localhost ~]$ echo $ORACLE_HOME
/u01/oracle/prod/tech_st/product/11.2.0/db_1
Current Home Loc:
[oracle@localhost ~]$ echo $ORACLE_HOME
/u01/oracle/db/tech_st/product/11.2.0/db_1
When i am trying the DBCA command i am getting the below error:
[oracle@localhost ~]$ dbca
java.lang.UnsatisfiedLinkError: Can't load library: /u01/oracle/prod/tech_st/product/11.2.0/db_1/oui/lib/linux/liboraInstaller.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:968)
at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.loadNativeLib(OiipuUnixOps.java:387)
at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.<clinit>(OiipuUnixOps.java:122)
at oracle.sysman.oii.oiip.oiipg.OiipgEnvironment.getEnv(OiipgEnvironment.java:201)
at oracle.sysman.oii.oiip.oiipg.OiipgPropertyLoader.initUnixPtrFileLoc(OiipgPropertyLoader.java:212)
at oracle.sysman.oii.oiip.oiipg.OiipgPropertyLoader.<clinit>(OiipgPropertyLoader.java:125)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.updateProperties(OiicStandardInventorySession.java:492)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.initSession(OiicStandardInventorySession.java:266)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.initSession(OiicStandardInventorySession.java:240)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.initSession(OiicStandardInventorySession.java:189)
at oracle.sysman.assistants.util.InventoryUtil.getOUIInvSession(InventoryUtil.java:346)
at oracle.sysman.assistants.util.InventoryUtil.getHomeName(InventoryUtil.java:87)
at oracle.sysman.assistants.util.OracleHome.getInventoryHomeName(OracleHome.java:1023)
at oracle.sysman.assistants.dbca.backend.Host.<init>(Host.java:798)
at oracle.sysman.assistants.dbca.ui.UIHost.<init>(UIHost.java:257)
at oracle.sysman.assistants.dbca.ui.InteractiveHost.<init>(InteractiveHost.java:54)
at oracle.sysman.assistants.dbca.Dbca.getHost(Dbca.java:164)
at oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:112)
at oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:184)
Exception in thread "main" java.lang.UnsatisfiedLinkError: no oraInstaller 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:993)
at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.loadNativeLib(OiipuUnixOps.java:405)
at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.<clinit>(OiipuUnixOps.java:122)
at oracle.sysman.oii.oiip.oiipg.OiipgEnvironment.getEnv(OiipgEnvironment.java:201)
at oracle.sysman.oii.oiip.oiipg.OiipgPropertyLoader.initUnixPtrFileLoc(OiipgPropertyLoader.java:212)
at oracle.sysman.oii.oiip.oiipg.OiipgPropertyLoader.<clinit>(OiipgPropertyLoader.java:125)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.updateProperties(OiicStandardInventorySession.java:492)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.initSession(OiicStandardInventorySession.java:266)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.initSession(OiicStandardInventorySession.java:240)
at oracle.sysman.oii.oiic.OiicStandardInventorySession.initSession(OiicStandardInventorySession.java:189)
at oracle.sysman.assistants.util.InventoryUtil.getOUIInvSession(InventoryUtil.java:346)
at oracle.sysman.assistants.util.InventoryUtil.getHomeName(InventoryUtil.java:87)
at oracle.sysman.assistants.util.OracleHome.getInventoryHomeName(OracleHome.java:1023)
at oracle.sysman.assistants.dbca.backend.Host.<init>(Host.java:798)
at oracle.sysman.assistants.dbca.ui.UIHost.<init>(UIHost.java:257)
at oracle.sysman.assistants.dbca.ui.InteractiveHost.<init>(InteractiveHost.java:54)
at oracle.sysman.assistants.dbca.Dbca.getHost(Dbca.java:164)
at oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:112)
at oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:184)
[oracle@localhost ~]$
I tried all possible ways with google help but still i am facing the same issue.Kindly check and suggest to solve the issue.
Thanks in advance.
Vijay.Hi all,
I give you the clear details about the issue what i am currently facing,
1. I installed the 11g (11.2.0) database alone(No EBS) in my local vmware machine.
2. Created my ORACLE_HOME under /u01/oracle/prod/tech_st/product/11.2.0/db_1 directory after that i tried to change my home location from /u01/oracle/prod/tech_st/product/11.2.0/db_1 location to /u01/oracle/db/tech_st/product/11.2.0/db_1 location, like created /u01/oracle/db directory and moved files from /u01/oracle/prod location.
3. I changed my bash_profile and exported home with the modified location also deregistered an old home and registered the new home.
4. When i am issuing echo $ORACLE_HOME it is showing the current home location and ORACLE_SID is same what i created before.
5. But when i am trying to create one more db using DBCA utility it is through the above error.
Please suggest me is it possible to change the location after db creation or any extra steps i have to do for this issue.
Thanks. -
Hi Experts,
I'm having an issue running cmsCollector.cmd. I run it in the command prompt and am presented with the following error:
java.lang.UnsatisfiedLinkError: Can't load Library %LINK_DIR%]BusinessObjects Enterprise 12.0\win32_x86\zlib.dll
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:968)
at com.acta.crystalrepo.crawler.CrawlerProgramBase.run(CrawlerProgramBase.java:117)
at com.acta.crystalrepo.crawler.CrystalCrawlerMain.getReportMetadata(CrystalCrawlerMain.java:204)
at com.acta.crystalrepo.crawler.CrystalCrawlerMain.main(CrystalCrawlerMain.java:80)
Any help would be appreciated.
Thanks,
Brian ComeauHi Manoj,
It seems like that got us past that step. Unfortunately, I have a new problem. Whereas the previous collection run stated that I had a number of Universes to collect (>40) it now says 0 for every type of object except folders.
I'm now getting the following error:
An unexpected error has been detected by HotSpot Virtual Machine:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7769a682, pid=3220, tid=5216
Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
Problematic frame:
C [ole32.dll+02a682]
Thanks for all of the help, I really appreciate it! -
Java.lang.UnsatisfiedLinkError: Can't load library: /
Hello
I downloaded the 32 bit JRE 5 for powerpc evaluation copy. When i try to execute the sample awt program using java.awt.headless=false. I'm getting following error.
java -Djava.awt.headless=false AWTExample
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /
mnt/usb/jre1.5.0_10/lib/ppc/xawt/libmawt.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:968)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
at java.awt.Component.<clinit>(Component.java:545)
please letme know where can i get ppc/xawt/libmawt.so.
Is there any alternate solution for it. Please help me in this regard.
Thanks and Regards
Murali KrishnaHi all,
I give you the clear details about the issue what i am currently facing,
1. I installed the 11g (11.2.0) database alone(No EBS) in my local vmware machine.
2. Created my ORACLE_HOME under /u01/oracle/prod/tech_st/product/11.2.0/db_1 directory after that i tried to change my home location from /u01/oracle/prod/tech_st/product/11.2.0/db_1 location to /u01/oracle/db/tech_st/product/11.2.0/db_1 location, like created /u01/oracle/db directory and moved files from /u01/oracle/prod location.
3. I changed my bash_profile and exported home with the modified location also deregistered an old home and registered the new home.
4. When i am issuing echo $ORACLE_HOME it is showing the current home location and ORACLE_SID is same what i created before.
5. But when i am trying to create one more db using DBCA utility it is through the above error.
Please suggest me is it possible to change the location after db creation or any extra steps i have to do for this issue.
Thanks. -
Java.lang.UnsatisfiedLinkError: Can't load library libmawt.so
Getting a java.lang.UnsatisfiedLinkError: Can't load library .../weblogic10.3.2/jrockit_160_14_R27.6.5-32/jre/lib/i386/xawt/libmawt.so for a Java application running on WL 10.3.2. Do you have any tips or the root cause for this error? Are there any CRs that resolve it?
check this thread http://forum.java.sun.com/thread.jsp?thread=326048&forum=32&message=1436823
-
Java.lang.UnsatisfiedLinkError: when called from a jar file
I have a class that calls a custom dll file. If I dont package the class files and set my system PATH to the location of the DLL then the VM is able to find the dll and load it successfully.
However, when I package the class files into a jar file, I get "java.lang.UnsatisfiedLinkError: NetworkAdapters" eventhough the system PATH is set to the correct location.
I have also tried to packaging the dll with the class files but this has not made any difference.
Library is called from Java as follows:
static {
System.loadLibrary("NetworkAdapters");
When packaged the classes files exist in the following sub directories com\instem\hci\adapters
Any help appreciated.Is it an executable Jar file?
The the DLL needs to sit in the same folders as the Jar itself.
(works for us). -
Java.lang.UnsatisfiedLinkError: running tomcat on java headless?
Dear all,
I'm using the iText library to generate pdfs from a database on the fly. Whenever I use some of it's features that require simple things like java.awt.Color, I get an java.lang.UnsatisfiedLinkError as shown:
java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64/libawt.so: libmlib_image.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)
at java.awt.Toolkit.<clinit>(Toolkit.java:1530)
at java.awt.Color.<clinit>(Color.java:250)
at tablereport.processRequest(tablereport.java:55)
at tablereport.doGet(tablereport.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)After some research and verifying that libawt.so physically exists I read somewhere that whenever java is installed no a linux box without x (in my case it's a remote vps) java omits certain graphics related libraries like AWT (naturally).
I also read that you can run java headless to avoid the dependencies to X. Now is there a way to run tomcat (or add variables to tomcat's startup.sh) to avoid having these dependencies?
Thanks for your help,
William[Googling the exception|http://www.google.com/search?q=java.lang.UnsatisfiedLinkError+at+java.awt.Color.%3Cclinit%3E%28Color.java%3A250%29+tomcat] learns me it's a bug in the mentioned Tomcat + JDK combo.
Upgrade to the latest if possible. -
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.
-
Java.lang.UnsatisfiedLinkError - Urgent please help
Hi,
I want to thank you for looking into this problem first.
I have a very headache problem for the past week. I have an applet that uses JNI to call an existing dll to get the system resources. It works fine on windows 2000 server with IE 5.0. The dll get loaded fine and the function call is working fine.
However, now I tried to move the applet to an application for me to test with jbuilder, I have problems and I get the error java.lang.UnsatisfiedLinkError: ooInit.
Does anyone know why this is happening in Jbuilder. I traced to see if the dll get loaded with System.loadlibrary("dll"), and it seems to load the library. But when I call the ooInit() native method, it throws that exception.
Please help. This will be greatly appreciated and I can do something for you guys in return.
Thank you so much.
Regards,
gunaHere, for the benefit of others who might search for this, is my approach to resolving this error.
Two things to note:
1. I didn't worry about paths, etc. - I was in a hurry so I just copied files into required directories.
2. I named both the Java and C files "mainFrame". I have not subsequently checked to see if this is required, since it worked for me.
Summary of getting jni routine to work with Jbuilder:
created Java project mintest, two principle classes - mainFrame and WelcomeFrame
key code fragments:
--------------------------------------- mainFrame --------------------------------------------------
package mintest;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JPanel;
import java.awt.GridBagLayout;
import java.awt.*;
import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
public class mainFrame {
boolean packFrame = false;
WelcomeFrame frame = new WelcomeFrame();
public static native int cRoutine(int value);
static {System.loadLibrary("mainFrame"); }
public mainFrame() {
//Pack frames that have useful preferred size info, e.g. from their layout
//Validate frames that have preset sizes
if (packFrame) {
frame.pack();
else {
frame.validate();
// Center the frame
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
frame.setLocation( (screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
try {
jbInit();
catch (Exception ex) {
ex.printStackTrace();
* Main method
* @param args String[]
static public void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
catch (Exception e) {
e.printStackTrace();
new mainFrame();
cRoutine(1); // this works at this point...
System.out.println("cRoutine - should be 4: " + cRoutine(3));
private void jbInit() throws Exception {
}--------------------------------------- end of mainFrame --------------------------------------------------
--------------------------------------- (portions of) WelcomeFrame --------------------------------------
package mintest;
import java.awt.*;
..... more imports, setting up of window, buttons, etc. .... iValue is an integer....
public void jToggleButton1_mousePressed(MouseEvent e) {
jToggleButton1.setText("cRoutine in: " + iValue + " out: " + (iValue =
mainFrame.cRoutine(iValue)));
}--------------------------------------- end of (portions of) WelcomeFrame -----------------------------
mainFrame was compiled with Jbuilder into a class file, makeFrame.class. That was copied into
the C:\Borland\JBuilder2005\jdk1.4\bin directory, and javah was run to create the C header file:
javah -jni mainFrame
This generated:
--------------------------------------- mainFrame.h generated by javah ----------------------------------
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class mainFrame */
#ifndef _Included_mainFrame
#define _Included_mainFrame
#ifdef __cplusplus
extern "C" {
#endif
* Class: mainFrame
* Method: cRoutine
* Signature: (I)I
JNIEXPORT jint JNICALL Java_mainFrame_cRoutine
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
#endif
#endif--------------------------------------- end of mainFrame.h generated by javah -------------------------
OKAY, HERE COMES THE CRITICAL STEP. DESPITE THE FACT THE COMMENT SAYS DO NOT EDIT, THIS FILE HAS TO BE EDITED TO INCLUDE THE PACKAGE NAME, LIKE THIS:
--------------------------------------- modified mainFrame.h ----------------------------------
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class mainFrame */
#ifndef _Included_mainFrame
#define _Included_mainFrame
#ifdef __cplusplus
extern "C" {
#endif
* Class: mainFrame
* Method: cRoutine
* Signature: (I)I
JNIEXPORT jint JNICALL Java_mintest_mainFrame_cRoutine
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
#endif
#endif--------------------------------------- end of modified mainFrame.h -------------------------
This file is then copied to the C:\Borland\BCC55\Include directory. The C code source is placed
in the C:\Borland\BCC55\Bin directory. Here is the C code - note that it has the package name in
the function name:
--------------------------------------- mainFrame.c ----------------------------------
#include <mainFrame.h>
#include <stdio.h>
#include <string.h>
/* must link gpib-32.obj for Windows*/
#include <windows.h> /*if using Windows */
void main(){
JNIEXPORT jint JNICALL
Java_mintest_mainFrame_cRoutine(JNIEnv *env, jobject callingObj,jint invalue)
return (jint) invalue+1;
}--------------------------------------- end of mainFrame.c -------------------------
This is now compiled on the command line (from the C:\Borland\BCC55\Bin directory) using:
bcc32 -tWD -I\Borland\bcc55\include -L\Borland\bcc55\lib mainFrame.c
Parameters: -tWD creates Windows DLL file
-I is path to include directory (this is where mainFrame.h is located)
-L is path to library directory
Compilation produces mainFrame.dll in the C:\Borland\BCC55\Bin directory. This is copied to the C:\Borland\JBuilder2005\jdk1.4\jre\bin directory so Jbuilder can find it. Then it works.
So, the key step is adding the package name after javah has generated the header file (and similarly using the package name in the .c source file.)
Hope this is useful. -
Greetings,
I'm trying to work with Oracle 9i Lite on PocketPC and I got one
exception when I try to use jdbc package (oljdbc40.jar):
java.lang.UnsatisfiedLinkError: no oljdbc40 in shared library
path
Since I didn't made the dll (is an Oracle product), I can't make
much about the dll or the native class file where the call take
place.
my standard definitions are:
-PocketPC (ipaq)
-Personal Java 1.1 beta
-I have my application in a JAR-based file in "\Program
Files\App"
-Oracle Lite installation in "\ORACE";
-dll files installed by oracle in "\Windows";
-wince registry classpath for JAR/CLASS file aimed
to "\ORACE\oljdbc40.jar"
So, what should I do to run my application that uses a jdbc
package from oracle based on a dll file?
I'm hopeful to solve this and avoid my thought from using any
Microsoft Visual tool...
thanks,
Pedro SalazarHi Pedro,
Did you ever get this problem fixed? I'm seeing the same issue running Personal Java 1.1 beta for StrongARM on PocketPC 2000 with Oracle 9i Lite 5.0.2
Any help much appreciated!
Thanks,
Simon. -
Java.lang.UnsatisfiedLinkError: no msawt in shared library path
I am using IE5.5 on Windows 98SE, and every time I try to run an applet, I get the error "java.lang.UnsatisfiedLinkError: no msawt in shared library path" I have installed the JDK/JRE, but it has not done anything. I discovered that I was missing msawt.dll from my windows/system folder, but when I got it, it had no effect on the error message. I have gotten the same applets to run on other win98/IE5.5 machines. I read of this same problem in a linux forum somewhere, but nobody had a solution. What should I do? Thanks.
Well, as tacky as it is to reply with the solution to my own problem, I found that installing a newer version of Microsoft's Java Virtual Machine, free from Microsoft's site, helped elminate that error. Perhaps this will help someone else.
-
Java.lang.UnsatisfiedLinkError: no muxer in java.library.path
error while starting weblogic
plz help meAccording to CR087944 for weblogic 6.1
"Running under Windows XP resulted in a java.lang.UnsatisfiedLinkError: no muxer in java.library.path error.
This is because WebLogic Server does not correctly report Windows XP as the host operating system. With JDK 1.3.1_03, os.name is returned "Windows 2000".
Modification of a method in the SocketMuxer resolved the problem.."
U need to get the service pack 5 or above in order to resolve this problem -
Hi,
I developed a Java application which uses JNI. Before I run the application, I set an environment variable JAVA_LIBRARY_PATH to where I put the .dll file required by my application. But when I try to run the application, I always get the exception of "java.lang.UnsatisfiedLinkError " saying that no the required .dll in java.library.path. Could anyone please tell me what's going on there ?(I am using JDK1.5.0_05.)
thanks !Hi Scott,
Thanks for your help !
I also tried setting PATH before. But with this setting I got another problem that if I tried to the application the second time or more times, it always gives me an exception saying that the dll library already loaded by another loader. That's why I moved to set JAVA_LIBRARY_PATH because this way ever worked for me when I used lower version of Java. I did not use -Djava.library.path= option because I want to invoke my application from web application which may use RMI or HTTP. -
The following is a re-posting of a thread regarding
UnsatisfiedLinkError issue. One author posted the workaround below.
That workaround was posted multiple times by mistake, and the
author asked Moderator to delete the extra posting.
An operating error caused the topic to be deleted instead of
the individual messages. I am reposting the content of the thread,
and apologize to the authors who participated in this thread
before.
Workaround :
I experienced the same issue when I tried to install Flex on
a new Vista system. Here's how I corrected it:
1) Navigate to C:\Program Files\Adobe\Flex Builder 2\plugins
2) Look for the file
"org.eclipse.swt.win32.win32.x86_3.1.2.jar". You will need to open
this in a file compression program such as WinRar or WinZip. If you
don't have such a program you can try:
2a) Copy (make sure you COPY, not MOVE) the file to another
location, such as your desktop.
2b) Rename the file with a ".zip" extension (i.e. change
".jar" to ".zip"). NOTE: You will not see the file extension if
your system is configured to hide extensions. In this case, open a
Windows Explorer window ("My Computer", etc.) and press the "Alt"
key. A menu bar will appear. Select "Tools -> Folder Options".
Select the "View" tab, and look for "Hide extensions for known file
types". Uncheck the box, then click OK.
2c) You should now be able to right-click the file and use
Vista's built-in .zip extraction to extract the contents to a
folder.
3) Within the org.eclipse.swt.win32.win32.x86_3.1.2.jar file
is a file called "swt-win32-3139.dll". Copy this file to
C:\Windows\System32\ (You will be asked for a confirmation when you
do this).
Once that is done, Flex should run correctly. You can now
delete the copy of the .jar file that you made, as well as the
folder created by Vista's .zip extraction (if applicable).
Hope this helps!
Error :
!SESSION 2007-04-20 10:16:39.138
eclipse.buildId=unknown java.version=1.4.2_12 java.vendor=Sun
Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86,
WS=win32, NL=en_GB Command-line arguments: -os win32 -ws win32
-arch x86
!ENTRY org.eclipse.update.configurator 2007-04-20 10:16:40.18
!MESSAGE Cannot backup current configuration !ENTRY
org.eclipse.update.configurator 2007-04-20 10:16:40.42
!MESSAGE Could not rename configuration temp file
!ENTRY org.eclipse.osgi 2007-04-20 10:16:40.938
!MESSAGE Application error
!STACK 1 java.lang.UnsatisfiedLinkError: no swt-win32-3139 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
org.eclipse.swt.internal.Library.loadLibrary(Library.java:123) at
org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18) at
org.eclipse.swt.widgets.Display.<clinit>(Display.java:125) at
org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:381)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:155) at
com.adobe.flexbuilder.standalone.FlexBuilderApplication.run(FlexBuilderApplication.java:4 5)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at
org.eclipse.core.launcher.Main.basicRun(Main.java:278) at
org.eclipse.core.launcher.Main.run(Main.java:973) at
org.eclipse.core.launcher.Main.main(Main.java:948) !ENTRY
org.eclipse.osgi 2007-04-20 10:16:40.948 !MESSAGE Bundle
update@plugins/com.adobe.flexbuilder.debug.e32_2.0.155577/ [70] was
not resolved. !SUBENTRY 1 org.eclipse.osgi 2007-04-20 10:16:40.948
!MESSAGE Missing required bundle
org.eclipse.debug.ui_[3.2.0,99.0.0).</Unfortunately I don't have the
"org.eclipse.swt.win32.win32.x86_3.1.2.jar" file. On my computer
the folder is not set up the same way (C:\Program Files\Adobe\Flex
Builder 2\plugins) instead it is set up as (C:\Program
Files\Adobe\Flex Builder 2\metadata\plugins) but I've looked in
everything and that file just isn't in there. I've re downloaded it
twice. Still not there. Is there anything else i can do. -
Hi
I have installed JasperAssistant in eclipse 3.2.2. But I am getting the following the error when I am trying to view the reports through the application. This error found only after the installation. Earlier I used to view the reports through the Eclipse.
Exception in thread "Thread-28" java.lang.UnsatisfiedLinkError: no swt-win32-3062 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 org.eclipse.swt.internal.Library.loadLibrary(Library.java:100)
at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18)
at org.eclipse.swt.graphics.Device.init(Device.java:564)
at org.eclipse.swt.widgets.Display.init(Display.java:1780)
at org.eclipse.swt.graphics.Device.<init>(Device.java:100)
at org.eclipse.swt.widgets.Display.<init>(Display.java:355)
at org.eclipse.swt.widgets.Display.<init>(Display.java:351)
at com.austco.client.gui.reports.ReportThread.run(ReportThread.java:40)
at java.lang.Thread.run(Unknown Source)
Could you please help me asap.
I tried some of the alternatives found in the web.
1. Changed the VM arguments: -Djava.library.path=${system:ECLIPSE_HOME}/plugins/org.eclipse.swt.win32_3.0.1/os/win32/x86
2. Set the environment variable PATH to the location of the dll.
But this doesn't work.
Your help is very much appreciated. Thanks in advance.Maybe you can report this to the makers of JasperAssistant or Eclipse. I think they are in a better position to help you since they made that plugin.
Maybe you are looking for
-
FM from SAP R3 or class to get open a specific document in EDMS
Hi Experts. I have a Z program, in this program the user can consult and make a lot of things with documents..., create, modify...etc... using BAPI_DOCUMENT functions... I want to go further away, and I would like to make open the document in EDMS di
-
Just noticed this forum so thought I'd post my question in here too... So, I [think] I just downloaded the latest CC desktop app/manager and when it finished etc and opened up, it's now telling me that I don't have any apps installed. I do, I have PS
-
Update episode release date....
I have an old episode that is at the bottom of my podcast that we wanted to move towards the top. In order to do this, I updated the "release date" of the episode in my feed to a more recent date. Sure enough, doing that moved the episode up exactly
-
What's with the TINY dot for the tags. In previous OX versions it was easy to spot a tagged item bcause the color went all the way across. Now there's just a LITTLE colored dot at the end of the first column. It makes it WAY harder to just see what i
-
I want a new iPhone. Plz read and help if you can.
I have a 4gb iPhone. I've done ALOT of damage to it. Not on purpose though. I've dropped it and the plastic black portion fell off and the silver part on the back 'ripped' and there is a crack in the bottom of it and one of the screws fell off. I hav