Operating System - HP-UX
1833875 Members
1809 Online
110063 Solutions
New Discussion

Re: how to load a 64bit library in Java

 
SOLVED
Go to solution
Bercher
New Member

how to load a 64bit library in Java

Hello everybody,
I use class/method System.loadLibrary() to load a DLL. This works fine for 32bit libraries, it fails for 64 bit libraries.
For example this library (info by 'file'):
libfpesv.sl: ELF-64 shared object file - PA-RISC 2.0 (LP64)
gives following error with above call:
java.lang.UnsatisfiedLinkError: /home/dbpm/bbe/test/libfpesv.sl:
specified file is not a shared library, or a format error was detected.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at LoadLib.(LoadLib.java:14)
at LoadLib.main(LoadLib.java:7)
I'm using Java version: Java HotSpot(TM) Server VM (build 1.4.1.4.0.01-020827-17:12-PA_RISC2.0 PA2.0, mixed mode)

Does somebody know ?
Regards, Bernhard Bercher (bbe@de.ibm.com
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: how to load a 64bit library in Java

Assuming this is a UX server and it appears to be here are a few questions.

Are you current on java required patches?

If not, go here, and get current.

http://www.hp.com/products1/unix/java/infolibrary/patches.html

You might want to make sure your current java directory is in the PATH and little things like that.

I would also be current on Quality packs and security patches, though this is less cricical than java patches.

I ran a search for your error message and got an extensive list back.

One of these docs might help. I'm sorry I don't have time to be more specific.

http://us-support.external.hp.com/emse/bin/doc.pl/sid=00574e7413ee10ee68?todo=search&searchcategory=ALL&rn=25&presort=rank&searchtext=specified+file+is+not+a+shared+library%2C+or+a+format+error+was+detected&searchcriteria=exactphrase&searchtype=SEARCH_TECH_DOCS&searchtype=SEARCH_MANUAL&searchtype=SEARCH_FORUMS&x=41&y=8

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stanimir
Trusted Contributor
Solution

Re: how to load a 64bit library in Java

Hi!
To invoke the 64-bits JVM from command line
option -d64 must be used.
Regards.
Nicolas Moulin_1
Occasional Advisor

Re: how to load a 64bit library in Java

Hi Bernhard,

We are facing the exact same problem with a 64-bits library (java.lang.UnsatisfiedLinkError).

Before, we used java1.3 so after reading this thread we have installed java1.4 (SDK1.4.1.00) and we have tried to invoke java using the -d64 option... But we still have the same problem.

Did you manage to solve your problem?

Thanks for your feedback.
Best Regards,
Nicolas
Amit_30
New Member

Re: how to load a 64bit library in Java

Hi,
I have the same error.

we add -d64 flag .

jdk verision:

Java HotSpot(TM) Server VM (build 1.4.1 1.4.1.02-030502-15:31-PA_RISC2.0 PA2.0, mixed mode)


and still get the same error.

Did it working for someone ?
please help.

Thanks.
ratuld
New Member

Re: how to load a 64bit library in Java

Iv got exactly the same problems
with the java -d64 command !!


java version "1.4.1.03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1.03-030630-19:37)
Java HotSpot(TM) 64-Bit Server VM (build 1.4.1 1.4.1.03-030701-00:55-PA_RISC2.0W PA2.0W, mixed mode)
I can load 32b shared librarys but not 64b !!

Have you solved your problem ??

I have red somewhere
http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/JNI_java2.html
that we can't load 64bits libraries !!!!

Is it true ??

Jean de Ratuld
Priti Kulkarni
New Member

Re: how to load a 64bit library in Java

Even I am facing the same problem.. Need Help..

thanks,
CA102