Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

JNI in 64bit machine

Thread view: 
j2eepgrmr - 02 Feb 2006 22:24 GMT
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
Nigel Wade - 03 Feb 2006 11:32 GMT
> 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 :(
Roedy Green - 03 Feb 2006 11:49 GMT
>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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.