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

Discussion in 'Java' started by markryde@gmail.com, Jan 19, 2007.

  1. Guest

    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
    , Jan 19, 2007
    #1
    1. Advertising

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

    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------
    Laurent D.A.M. MENTEN, Jan 19, 2007
    #2
    1. Advertising

  3. Tom Hawtin Guest

    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
    Tom Hawtin, Jan 19, 2007
    #3
  4. 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
    >
    > 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
    > >
    Timothy Bendfelt, Jan 19, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig Dunstan
    Replies:
    1
    Views:
    3,141
    Scott Allen
    Jan 27, 2004
  2. Jared
    Replies:
    1
    Views:
    663
    Harald Hein
    Jul 8, 2003
  3. John
    Replies:
    2
    Views:
    496
    Gordon Beaton
    Apr 7, 2005
  4. Replies:
    4
    Views:
    1,714
    Gordon Beaton
    Mar 28, 2007
  5. harijay
    Replies:
    2
    Views:
    476
    Gabriel Genellina
    Feb 19, 2009
Loading...

Share This Page