I have a dynamic library compiled on a 32 bit Linux machine. Is it
possible to run it on a 64-bit machine?
The following link says ...
http://java.sun.com/j2se/1.4.2/docs/guide/vm/
Users of the Java Native Interface will need to recompile their code to
be able to run it on the 64-bit VM.
Currently I don't have access to 64-bit machine, so I am trying to see
if anyone has run across this issue.
Thanks
> I have a dynamic library compiled on a 32 bit Linux machine. Is it
> possible to run it on a 64-bit machine?
[quoted text clipped - 10 lines]
>
> Thanks
The simplest solution would be to use a 32bit JVM on the 64bit machine. How well
this works will depend on the processor.
Can you build a 64bit version of the library on a 32bit platform, using compiler
options to specify the architecture? You can certainly build 32bit
objects/libraries using gcc on Linux/AMD64 using the -m32 flag and there is a
corresponding -m64 flag to indicate 64bit objects which might do the trick.

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
j2eepgrmr - 03 Feb 2006 17:56 GMT
Thanks Nigel. I saw the compiler option in g++ and tried it out on a 32
bit Linux box and here is what I got.
g++ -m64 test2.cpp
cc1plus: sorry, unimplemented: 64-bit mode not compiled in
So I need a 64 bit machine to compile :(
>Users of the Java Native Interface will need to recompile their code to
>be able to run it on the 64-bit VM.
With JAWS you put the 64-bit compiled JNI code in a different jar,
and explain in the JNLP which jar goes with which platform and from
there, getting the right one is automatic.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
j2eepgrmr - 03 Feb 2006 17:58 GMT
Roedy ...
I'll check out JAWS. The native code I have is really simple and I
didn't try to use any third party s/w earlier.
Thanks
Roedy Green - 03 Feb 2006 23:34 GMT
>I'll check out JAWS. The native code I have is really simple and I
>didn't try to use any third party s/w earlier
My first JNI project was in an Applet, SetClock. The nightmare was
getting the DLL in place on the path somewhere and recognized. This
becomes platform/browser dependent code. I eventually put it on the
shelf as too unreliable. The I resurrected it as a JAWS app with no
trouble.
With JAWS, getting your DLL on the path before you app starts to
execute, is automatic.
see http://mindprod.com/jgloss/javawebstart.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.