Where to put the dlls when using JNI

Discussion in 'Java' started by bearice@gmail.com, Feb 16, 2007.

  1. Guest

    Hello all,
    I'm tring to pack a dll into a jar file,but I can't load it. What can
    i do for it?
    , Feb 16, 2007
    #1
    1. Advertising

  2. Sanjay Guest

    wrote:
    > Hello all,
    > I'm tring to pack a dll into a jar file,but I can't load it. What can
    > i do for it?
    >


    Not sure about windows, but may be you can deduce something from this.

    While developing jni program on linux, i used to put by .so files
    (shared library objects, which are like dynamic linked libraries) in the
    LD_LIBRARY_PATH.

    HTH

    Sanjay
    Sanjay, Feb 17, 2007
    #2
    1. Advertising

  3. Chris Uppal Guest

    wrote:

    > I'm tring to pack a dll into a jar file,but I can't load it. What can
    > i do for it?


    DLLs are loaded by the OS (well, actually I don't think that's technically
    true, but it's close enough), so the DLL has to be somewhere where the OS can
    read it. JAR files don't count. You'll have to extract the DLL from the JAR
    before using it.

    (Or else use some really /serious/ low-level magic to extract the DLL data from
    the JAR and map it directly into your Windows process's address space, do any
    fixups, etc... ;-)

    -- chris
    Chris Uppal, Feb 17, 2007
    #3
  4. Chris Uppal wrote:
    > wrote:
    >> I'm tring to pack a dll into a jar file,but I can't load it. What can
    >> i do for it?

    >
    > DLLs are loaded by the OS (well, actually I don't think that's technically
    > true, but it's close enough), so the DLL has to be somewhere where the OS can
    > read it.


    Yep.

    > JAR files don't count. You'll have to extract the DLL from the JAR
    > before using it.
    >
    > (Or else use some really /serious/ low-level magic to extract the DLL data from
    > the JAR and map it directly into your Windows process's address space, do any
    > fixups, etc... ;-)


    Extracting the dll files from the jar file to disk from the running Java
    code before loading them the standard way would be less magic.

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Feb 17, 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. Jim Bancroft
    Replies:
    5
    Views:
    559
    =?Utf-8?B?QnJhZCBRdWlubg==?=
    Aug 13, 2004
  2. ian ward
    Replies:
    0
    Views:
    487
    ian ward
    May 19, 2005
  3. ian ward
    Replies:
    2
    Views:
    673
    ian ward
    Jun 22, 2005
  4. pcarr01
    Replies:
    1
    Views:
    377
    Larry Brasfield
    Feb 18, 2005
  5. Eric
    Replies:
    0
    Views:
    431
Loading...

Share This Page