including LD_LIBRARY_PATH in JAR manifest file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

including LD_LIBRARY_PATH in JAR manifest file

Tranquil
Hi,

i'm deploying a java application (jar) on a linux server using rpm
(maven-rpm-plugin).

the jar uses JNI code which needs LD_LIBRARY_PATH defined, in order to find
the .so files.

can i define it in the manifest file (similar to class-path?)

what's the best practice to do it?

I've tried putting it in the cron file that launch the app but
it doesn't work..

thanks.

--
Eyal Edri
Reply | Threaded
Open this post in threaded view
|

Re: including LD_LIBRARY_PATH in JAR manifest file

Jochen Stiepel
Hi Eydal,

as far as I know you need to set the environment variable 'LD_LIBRARY_PATH'
before you start the java application.

export LD_LIBRARY_PATH=/path/with/the/so/file
after that, starting the java app.

CU,
Jochen


2010/4/12 eyal edri <[hidden email]>

> Hi,
>
> i'm deploying a java application (jar) on a linux server using rpm
> (maven-rpm-plugin).
>
> the jar uses JNI code which needs LD_LIBRARY_PATH defined, in order to find
> the .so files.
>
> can i define it in the manifest file (similar to class-path?)
>
> what's the best practice to do it?
>
> I've tried putting it in the cron file that launch the app but
> it doesn't work..
>
> thanks.
>
> --
> Eyal Edri
>
Reply | Threaded
Open this post in threaded view
|

Re: including LD_LIBRARY_PATH in JAR manifest file

Tranquil
Yea.. i think that's the only way,

what i did is to add a script to /etc/profile.d/set_ld_path.sh

with the line: export LD_LIBRARY_PATH=/path/with/the/so/file

so it will work for all users.

Eyal.

On Tue, Apr 13, 2010 at 2:14 PM, Jochen Stiepel <[hidden email]> wrote:

> Hi Eydal,
>
> as far as I know you need to set the environment variable 'LD_LIBRARY_PATH'
> before you start the java application.
>
> export LD_LIBRARY_PATH=/path/with/the/so/file
> after that, starting the java app.
>
> CU,
> Jochen
>
>
> 2010/4/12 eyal edri <[hidden email]>
>
> > Hi,
> >
> > i'm deploying a java application (jar) on a linux server using rpm
> > (maven-rpm-plugin).
> >
> > the jar uses JNI code which needs LD_LIBRARY_PATH defined, in order to
> find
> > the .so files.
> >
> > can i define it in the manifest file (similar to class-path?)
> >
> > what's the best practice to do it?
> >
> > I've tried putting it in the cron file that launch the app but
> > it doesn't work..
> >
> > thanks.
> >
> > --
> > Eyal Edri
> >
>



--
Eyal Edri