kung
asked on
java, whence AND ksh
Hi
I installed the jre1.2jfc yesterday but can not get it working.
It is Solaris 2.5
The error messsage look like this
Error: can't find libjava.so.
the .java-wrapper file looks like this in the beginning
#!/bin/ksh -p
PRG=`whence $0` >/dev/null 2>&1
but if I echo out $0 ( echo "0 = ${0}" ) it look like this
0 = /bin/ksh
The $0 is "messaed up", it is set to "/bin/ksh" instead of
"/opt/tmos/bom/java/jre1.2 fcs/bin/ja va"
$0 shoulbd be set to this value becouse I try to start the JVM
like this
/opt/tmos/bom/java/jre1.2f cs/bin/jav a myProgram $*
Some ideas why $0 is messed up ?
I installed the jre1.2jfc yesterday but can not get it working.
It is Solaris 2.5
The error messsage look like this
Error: can't find libjava.so.
the .java-wrapper file looks like this in the beginning
#!/bin/ksh -p
PRG=`whence $0` >/dev/null 2>&1
but if I echo out $0 ( echo "0 = ${0}" ) it look like this
0 = /bin/ksh
The $0 is "messaed up", it is set to "/bin/ksh" instead of
"/opt/tmos/bom/java/jre1.2
$0 shoulbd be set to this value becouse I try to start the JVM
like this
/opt/tmos/bom/java/jre1.2f
Some ideas why $0 is messed up ?
ASKER
The error message
"Error: can't find libjava.so. "
Is a consequens from that the $0 is messed up. The problem is
that .java-wrapper line
PRG=`whence $0` >/dev/null 2>&1
will result in that PRG = "/bin/ksh" instead of
"/opt/tmos/bom/java/jre1.2 fcs/bin/ja va"
Regards
"Error: can't find libjava.so. "
Is a consequens from that the $0 is messed up. The problem is
that .java-wrapper line
PRG=`whence $0` >/dev/null 2>&1
will result in that PRG = "/bin/ksh" instead of
"/opt/tmos/bom/java/jre1.2
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First a confession. I do not have any experience with Java let alone "jre1.2jfc" on Solaris 2.5.
>Error: can't find libjava.so
From the above error it is evident that some executable cannot find the shared object/library 'libjava.so'. Most likely it is "/opt/tmos/bom/java/jre1.2 fcs/bin/ja va". Under Solaris, the environment variable LD_LIBRARY_PATH indicates the list of directories where the shared objects can be found.
Now the fix would be to:
1. verify that you indeed have the shared library 'libjava.so' on your machine; if it is not present, you need to *get* it.
2. and if the file is present, make sure that the location (the directory where this file is present) is added to the list of directories pointed by LD_LIBRARY_PATH
IMhO, there is nothing wrong with your .java-wrapper or the $0!
You are actually executing '/opt/tmos/bom/java/jre1.2 fcs/bin/ja va' when you do
/opt/tmos/bom/java/jre1.2f cs/bin/jav a myProgram $* .
So when does the .java-wrapper get executed or read and by whom?
>Error: can't find libjava.so
From the above error it is evident that some executable cannot find the shared object/library 'libjava.so'. Most likely it is "/opt/tmos/bom/java/jre1.2
Now the fix would be to:
1. verify that you indeed have the shared library 'libjava.so' on your machine; if it is not present, you need to *get* it.
2. and if the file is present, make sure that the location (the directory where this file is present) is added to the list of directories pointed by LD_LIBRARY_PATH
IMhO, there is nothing wrong with your .java-wrapper or the $0!
You are actually executing '/opt/tmos/bom/java/jre1.2
/opt/tmos/bom/java/jre1.2f
So when does the .java-wrapper get executed or read and by whom?
ASKER
Hi
Thanks for Your answear
>>Error: can't find libjava.so
>From the above error it is evident that some executable cannot fin
Again, this error message is a result from the fact that the
$0 is messed up becouse .java_wrapper do things like this
in the beginning
PRG=`whence $0` >/dev/null 2>&1
progname=`/usr/bin/basenam e $0`
these , PRG and progname, is later used to find lib files
/opt/tmos/bom/java/jre1.2f cs/bin/jav a is just a link to
/opt/tmos/bom/java/jre1.2f cs/bin/.ja va_wrapper
I have solved it.
The reason why the .java_wrapper $0 was messed up was becouse
the s bit was set like this
-rwxrws--- 1 tmosadm tmos 267 Nov 11 15:49 .java_wrapper
This resultet in the funny behaviour, if the s bit is removed
this will result in a correct $0
Regards
Thanks for Your answear
>>Error: can't find libjava.so
>From the above error it is evident that some executable cannot fin
Again, this error message is a result from the fact that the
$0 is messed up becouse .java_wrapper do things like this
in the beginning
PRG=`whence $0` >/dev/null 2>&1
progname=`/usr/bin/basenam
these , PRG and progname, is later used to find lib files
/opt/tmos/bom/java/jre1.2f
/opt/tmos/bom/java/jre1.2f
I have solved it.
The reason why the .java_wrapper $0 was messed up was becouse
the s bit was set like this
-rwxrws--- 1 tmosadm tmos 267 Nov 11 15:49 .java_wrapper
This resultet in the funny behaviour, if the s bit is removed
this will result in a correct $0
Regards
kung, Can you post the entire content or ".java-wrapper" here, please.
find / - name 'libjava.so' -print
And if it is present, make sure that the location of this file is added to the environment variable LD_LIBRARY_PATH. If not, add by
export LD_LIBRARY_PATH=$LD_LIBRAR
and try your java program