$ /opt/java1.4/bin/java -d32 -jar jHw.jar
Failed to load MycompAPI and MycompAPI_64 libraries.
java.lang.UnsatisfiedLinkError: no MycompAPI_64 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1542)
at java.lang.Runtime.loadLibrary0(Runtime.java:795)
at java.lang.System.loadLibrary(System.java:834)
at com.chrysalisits.crypto.MycompAPI.<clinit>(MycompAPI.java:
47)
at com.chrysalisits.crypto.MycompHwManager.<init>
(MycompHwManager.java:101)
at com.chrysalisits.crypto.MycompHwManager.getInstance
(MycompHwManager.java:62)
at jHw.jHw.<init>(jHw.java:32)
at jHw.jHw.main(jHw.java:764)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize
at com.chrysalisits.crypto.MycompAPI.Initialize(Native Method)
at com.chrysalisits.crypto.MycompHwManager.<init>
(MycompHwManager.java:107)
at com.chrysalisits.crypto.MycompHwManager.getInstance
(MycompHwManager.java:62)
at jHw.jHw.<init>(jHw.java:32)
at jHw.jHw.main(jHw.java:764)
$ /opt/java1.4/bin/java -d32 -version
java version "1.4.2.19"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.4.2.19-080514-21:19)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.19-080515-02:54-IA64N
IA64, mixed mode)
$ /opt/java1.5/bin/java -d32 -version
java version "1.5.0.13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.13-
_09_may_2008_11_35)
Java HotSpot(TM) Server VM (build 1.5.0.13 jinteg:05.09.08-16:53 IA64,
mixed mode)
$ /opt/java6/bin/java -d32 -version
java version "1.6.0.01"
Java(TM) SE Runtime Environment (build 1.6.0.01-
jinteg_06_jun_2008_13_24-b00)
Java HotSpot(TM) Server VM (build 1.6.0.01 jinteg:06.07.08-04:50 IA64,
mixed mode)
What this error means is that the library MycompAPI_64 (MycompAPI_64.so
on *nix machines, MycompAPI_64.dll) cannot be found in the library path
for Java 1.4.
If you print out the System property "java.library.path" under all the
versions, you can track down the location of the library and copy it to
the 1.4 library path.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
I had done this for java 1.6, 1.5 and 1.4 respectively but it did not
solve "java.library.path" problem.
export CLASSPATH=.:/opt/java6/jre/lib/ext
export SHLIB_PATH=.:/opt/java6/jre/lib/ext
export CLASSPATH=.:/opt/java1.5/jre/lib/ext
export SHLIB_PATH=.:/opt/java1.5/jre/lib/ext
export CLASSPATH=.:/opt/java1.4/jre/lib/ext
export SHLIB_PATH=.:/opt/java1.4/jre/lib/ext
I had copied all the required files to /opt/java6/jre/lib/ext, /opt/
java1.5/jre/lib/ext, /opt/java1.4/jre/lib/ext.
java.library.path for java 1.4 is set up as:
/opt/java1.4/jre/lib/IA64N:/opt/java1.4/jre/lib/IA64N/server:/opt/
java1.4/jre/../lib/IA64N:.:/opt/java1.4/jre/lib/ext:/usr/lib
Why java 1.4 still fail?
Which java version did you compile with?
BugBear
I compiled with java 1.4.2.08 on another hpux computer and copied the
files to this hpux computer.
The build machine info are:
# java -version
java version "1.4.2.08"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.4.2.08-050401-17:46)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.08-050401-19:15-
PA_RISC1.1 PA1.1, mixed mode)
# uname -a
HP-UX hp2 B.11.00 U 9000/785 2003725330 unlimited-user license
>My JNI program is working with java 1.5 & 1.6 but fail with java 1.4
>on a HP-UX B.11.23 U ia64 computer.
>Please help even though java 1.4 is old.
see http://mindprod.com/jgloss/jni.html
Check the library path in both cases.
Your native code must be on the library path.
--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP
/opt/java1.4/jre/lib/IA64N:/opt/java1.4/jre/lib/IA64N/server:/opt/
java1.4/jre/../lib/IA64N:/opt/java1.4/jre/lib/ext:.:/usr/lib
/opt/java6/jre/lib/IA64N:/opt/java6/jre/lib/IA64N/server:/opt/java6/
jre/../lib/IA64N:/opt/java6/jre/lib/ext:.:/usr/lib
My native code is copied to both /opt/java1.4/jre/lib/ext and /opt/
java6/jre/lib/ext.
I do not understand why java 1.4 do not find it but java 1.6 find it.
Problem is solved!
My native code cause load error with java 1.4 but not java 1.6.
Changing the compile options solve this problem.