L
Lax
Hi all,
I'm trying to rewrite a Bourne shell script in Perl.
The shell script, among other things, sets the LD_LIBRARY_PATH and
CLASSPATH variables, exports them and kicks off a Java process.
LD_LIBRARY_PATH=NewLibPath; export LD_LIBRARY_PATH
CLASSPATH=NewClassPath; export CLASSPATH
$java JavaClass
This works fine and the new values for LIBPATH and CLASSPATH are
passed on fine to the Java process.
In my Perl rewrite, I'm doing,
$ENV{CLASSPATH}="NewClassPath" ;
$ENV{LD_LIBRARY_PATH}="NewLibPath";
system("$java JavaClass");
The CLASSPATH part works fine, but the new setting for LIB_PATH
doesn't seem to be working.
I also tried,
system("export LD_LIBRARY_PATH;$java -cp $ENV{CLASSPATH} JavaClass");
This too doesn't seem to have any effect.
A Google search on this issue shows this exchange on c.l.p.m,
http://tinyurl.com/333h64
I'm leaning towards setting LD_LIB_PATH from a shell wrapper around
the perl script, but I wonder
if there are more elegant ways of doing this? Does anyone have any
pointers for me?
Platform: The script would run on Linux , Solaris and AIX.
Thanks for your time,
Lax
I'm trying to rewrite a Bourne shell script in Perl.
The shell script, among other things, sets the LD_LIBRARY_PATH and
CLASSPATH variables, exports them and kicks off a Java process.
LD_LIBRARY_PATH=NewLibPath; export LD_LIBRARY_PATH
CLASSPATH=NewClassPath; export CLASSPATH
$java JavaClass
This works fine and the new values for LIBPATH and CLASSPATH are
passed on fine to the Java process.
In my Perl rewrite, I'm doing,
$ENV{CLASSPATH}="NewClassPath" ;
$ENV{LD_LIBRARY_PATH}="NewLibPath";
system("$java JavaClass");
The CLASSPATH part works fine, but the new setting for LIB_PATH
doesn't seem to be working.
I also tried,
system("export LD_LIBRARY_PATH;$java -cp $ENV{CLASSPATH} JavaClass");
This too doesn't seem to have any effect.
A Google search on this issue shows this exchange on c.l.p.m,
http://tinyurl.com/333h64
I'm leaning towards setting LD_LIB_PATH from a shell wrapper around
the perl script, but I wonder
if there are more elegant ways of doing this? Does anyone have any
pointers for me?
Platform: The script would run on Linux , Solaris and AIX.
Thanks for your time,
Lax