?
Solved

java, whence AND ksh

Posted on 1998-11-11
6
Medium Priority
?
682 Views
Last Modified: 2013-12-27
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.2fcs/bin/java"

$0 shoulbd be set to this value becouse I try to start the JVM
like this
/opt/tmos/bom/java/jre1.2fcs/bin/java myProgram $*

Some ideas why $0 is messed up ?

0
Comment
Question by:kung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:seedy
ID: 2007755
First verify if the file 'libjava.so' is present. You can do this by
   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_LIBRARY_PATH:<location of libjava.so>

and try your java program
0
 

Author Comment

by:kung
ID: 2007756
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.2fcs/bin/java"


Regards




0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 800 total points
ID: 2007757
you called it with a blank between  .  and java_wrapper, like

   prompt#  .   java_wrapper

If your file is named java_wrapper, call it as follows:

    prompt#  java_wrapper
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 2

Expert Comment

by:seedy
ID: 2007758
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.2fcs/bin/java".  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.2fcs/bin/java' when you do
/opt/tmos/bom/java/jre1.2fcs/bin/java myProgram $* .
So when does the .java-wrapper get executed or read and by whom?
0
 

Author Comment

by:kung
ID: 2007759
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/basename $0`


these , PRG and progname, is later used to find lib files


/opt/tmos/bom/java/jre1.2fcs/bin/java is just a link to
/opt/tmos/bom/java/jre1.2fcs/bin/.java_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

0
 
LVL 2

Expert Comment

by:seedy
ID: 2007760
kung, Can you post the entire content or ".java-wrapper" here, please.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question