f



"LoadLibrary" of a 32 bit so with 64 bit java on a 64 bit machine

Hello,

I have an x86_64 linux machine.

The java installed there is Sun java for linux (64 bit version- Linux
x64 Platform
- Java(TM) SE Development Kit 6)

I have a library (.so) which includes JNI calls.
This library was compiled on a 32 bit machine and I don't have it's
sources.
When running a jar in the usual way, if I try "LoadLibrary" on this
machine
from the java code I get an error.

Is there a way to run the jar in "32 bit mode" on this machine with
this
64 bit java ?
Which flag to the "java" command should I pass in order to achive this
?

Or is the only way to do this is install a 32 bit version of Java on
this
machine and run the jar from this 32 bit environment ? 

Regards,
Mark

0
markryde (47)
1/19/2007 5:48:50 PM
comp.lang.java.programmer 52714 articles. 1 followers. Post Follow

3 Replies
941 Views

Similar Articles

[PageSpeed] 47

I am affraid the is no solution but to install a 32bits JVM

markryde@gmail.com wrote:
> Hello,
> 
> I have an x86_64 linux machine.
> 
> The java installed there is Sun java for linux (64 bit version- Linux
> x64 Platform
> - Java(TM) SE Development Kit 6)
> 
> I have a library (.so) which includes JNI calls.
> This library was compiled on a 32 bit machine and I don't have it's
> sources.
> When running a jar in the usual way, if I try "LoadLibrary" on this
> machine
> from the java code I get an error.
> 
> Is there a way to run the jar in "32 bit mode" on this machine with
> this
> 64 bit java ?
> Which flag to the "java" command should I pass in order to achive this
> ?
> 
> Or is the only way to do this is install a 32 bit version of Java on
> this
> machine and run the jar from this 32 bit environment ? 
> 
> Regards,
> Mark
> 


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--- s: a C++ UL+++ P-- L+++ E--- W++ N++ o-- K-- w---
O- M- V- PS+ PE-- Y+ PGP- t 5 X+++ R* tv++ b+ DI++ D--
G e++ h--- r+++ y+++
------END GEEK CODE BLOCK------
0
1/19/2007 5:55:32 PM
markryde@gmail.com wrote:
> 
> Is there a way to run the jar in "32 bit mode" on this machine with
> this
> 64 bit java ?
> Which flag to the "java" command should I pass in order to achive this
> ?

You will need a 32-bit version. If both the 32 and 64-bit versions are 
installed in the same place, -d32 (and -d64) will switch between 
i386/i586 and AMD64 architectures.

Tom Hawtin
0
usenet120 (1728)
1/19/2007 7:46:37 PM

Depending on what the library does you could use a peer 32-bit process
and try an IPC solution. More complicated but if thats all you've got to
work with it may be a solution.

> I am affraid the is no solution but to install a 32bits JVM
>
> markryde@gmail.com wrote:
> > Hello,
> >
> > I have an x86_64 linux machine.
> >
> > The java installed there is Sun java for linux (64 bit version- Linux
> > x64 Platform
> > - Java(TM) SE Development Kit 6)
> >
> > I have a library (.so) which includes JNI calls.
> > This library was compiled on a 32 bit machine and I don't have it's
> > sources.
> > When running a jar in the usual way, if I try "LoadLibrary" on this
> > machine
> > from the java code I get an error.
> >
> > Is there a way to run the jar in "32 bit mode" on this machine with
> > this
> > 64 bit java ?
> > Which flag to the "java" command should I pass in order to achive this
> > ?
> >
> > Or is the only way to do this is install a 32 bit version of Java on
> > this
> > machine and run the jar from this 32 bit environment ?
> >
> > Regards,
> > Mark
> >
0
bendfelt (18)
1/19/2007 10:30:45 PM
Reply: