1833780 Members
2255 Online
110063 Solutions
New Discussion

sh: java: not found

 
SOLVED
Go to solution
Roslyn Faicol
Occasional Advisor

sh: java: not found

Could someone help me on this.

I am trying to check what version of java is installed in our box.

I tried to check it first using the ff command.
# swlist -l product | grep -i java

and got this.
ISEE-Java A.01.31.12 RST Java Runtime13-13109
Java-PlugIn1-2 1.2.2.15.00 Plug-In for Java 2
Java2RTE_base 1.2.2.15.00 Java 2 RTE (700/800), PA1.1 Portable
Java2RTE_doc 1.2.2.15.00 Java 2 RTE (700/800), Distribution Licens
e
Java2RTE_perf 1.2.2.15.00 Java 2 RTE (700/800), PA2.0 Performance A
dd On
Jdk13 1.3.1.13.01 Java2 1.3 SDK
Jdk14 1.4.2.04.00 Java2 1.4 SDK
Jpi13 1.3.1.13.01 Java2 1.3 Netscape Plugin
Jpi14 1.4.2.04.00 Java2 1.4 Netscape Plugin
Jre13 1.3.1.13.01 Java2 1.3 RTE 1.3
Jre14 1.4.2.04.00 Java2 1.4 RTE

However, when i tried accessing the command : #opt/java1.3/bin/java -version
sh: java: not found

Is there something wrong with my command?
7 REPLIES 7
Yang Qin_1
Honored Contributor

Re: sh: java: not found

run ll -d /opt/java* and find where is your java installed.

Yang
Peter Godron
Honored Contributor
Solution

Re: sh: java: not found

Hi Roslyn,
you may be missing a "/" before opt ?
/opt/java1.3/bin/java -version

You could also try to verify the path with:
which java
Roslyn Faicol
Occasional Advisor

Re: sh: java: not found

I run the command :
# ll -d /opt/java*
here's the result.

dr-xr-xr-x 4 bin bin 96 Jun 3 2005 /opt/java1.2
dr-xr-xr-x 7 bin bin 8192 Jun 3 2005 /opt/java1.3
dr-xr-xr-x 8 bin bin 8192 Jun 3 2005 /opt/java1.4
Roslyn Faicol
Occasional Advisor

Re: sh: java: not found

Hi Peter,

Thanks, you are correct I did miss the /. However, there are two java installed in the system,how would I know which is currently being used?

java version "1.3.1.13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1.13-040210-15:41)
Java HotSpot(TM) Server VM (build 1.3.1 1.3.1.13-_10_feb_2004_17_15 PA2.0, mixed
mode)
svprfaic@unphod54:/>/opt/java1.4/bin/java -version
java version "1.4.2.04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.04-040628-18:09)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.04-040628-20:03-PA_RISC2.0 PA2.0 (
aCC_AP), mixed mode)

Thanks
Peter Godron
Honored Contributor

Re: sh: java: not found

Hi,
most systems create a link from whichever version they want to use to /opt/java/bin, as most installs use this location.

However, if you prefer you can include your chosen java location in $PATH:
First check existsing path value:
echo $PATH | grep -i java
If not set, you can add with:
export PATH=$PATH:/opt/java1.3/bin

The export command could also be added to your .profile script in your home directory.

If your "which java" command did not return the location of a java directory, you environment does not include a valid java location.
See "man which"
Roslyn Faicol
Occasional Advisor

Re: sh: java: not found

Thanks for your patience... I understand everything clearly.

Re: sh: java: not found

Maam... This is Ferdinand G. Mag-isa... are you a professor? do you know miss Viana?