Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

/bin/java: No such file or directory

Highlighted
ppm9
Regular Collector

/bin/java: No such file or directory

We are currently on 7.1 and would be upgrading to 9.13. We refreshed our DEV instance with Prod and installed JDK1.5.0_11.

 

We set the JAVA_HOME and PATH. But, we are getting error when executing sh kStatus.sh.

 

After login:

: invalid option name

: octal number out of range

: command not found

: command not found

: command not found

: command not found

cd /

java -version

java version "1.5.0_11"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)

Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)

cd /hppm/bin

sh kStatus.sh

/bin/java: No such file or directoryk1.5.0_11

JAVA_HOME = /usr/lib/java/jdk1.5.0_11

/bin/java: No such file or directoryjdk1.5.0_11

/bin/java: No such file or directorydk1.5.0_11

 

Not sure whats going wrong.

21 REPLIES
Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

It would seem that what you are trying to use for the Java executable is not correct.  You path should include $JAVA_HOME/bin so that the correct version of Java is being used.  The commands seem to be looking for /bin/java and that could be a link to nowhere.

ppm9
Regular Collector

Re: /bin/java: No such file or directory

Thanks Jason for your reply.

But, $PATH is showing correct path.

Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

Can you post the $path variable?  If the /bin directory is before the $JAVA_HOME entry, it will try to use the /bin/java file that isn't working.

ppm9
Regular Collector

Re: /bin/java: No such file or directory

Here's $PATH variable

 

/usr/lib/java/jdk1.5.0_11/bin:/u01/app/oracle/product/10.2/client/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/home/hppm/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin

Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

Try running these commands:

 

which java

echo ${JAVA_HOME}

${JAVA_HOME}/bin/java -version

ppm9
Regular Collector

Re: /bin/java: No such file or directory

cd /usr/lib/java/jdk1.5.0_11/bin
/usr/lib/java/jdk1.5.0_11/bin> java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)

Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

That's not what I asked for. I was looking to see how the system translates things, but CDing into that directory defeats the point.
ppm9
Regular Collector

Re: /bin/java: No such file or directory

Sorry. Got it

 

echo ${JAVA_HOME}
/usr/lib/java/jdk1.5.0_11
${JAVA_HOME}/bin/java -version
/bin/java: No such file or directory

Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

This shows that the JAVA_HOME variable isn't being translated properly as part of a command. That's why the error is coming back /bin/java doesn't exist. Try this command:

$JAVA_HOME/bin/java -version
ppm9
Regular Collector

Re: /bin/java: No such file or directory

$JAVA_HOME/bin/java -version
/bin/java: No such file or directory

Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

Let's try this one again:

which java
ppm9
Regular Collector

Re: /bin/java: No such file or directory

which java
/usr/lib/java/jdk1.5.0_11/bin/java

Jim Esler
Honored Contributor

Re: /bin/java: No such file or directory

Your Java install may be bad. What is the output from:

 

ls -l $JAVA_HOME/bin

ppm9
Regular Collector

Re: /bin/java: No such file or directory

ls -l $JAVA_HOME/bin
/bin: No such file or directory_11

Jim Esler
Honored Contributor

Re: /bin/java: No such file or directory

As Jason said, your $JAVA_HOME environment variable is not being interpreted properly. What does the command look like that is setting it. Are you running under the Bourne (or Bash) shell?

ppm9
Regular Collector

Re: /bin/java: No such file or directory

I am setting the JAVA_HOME in .profile file as below:

 

#Java Variables

#export JAVA_HOME=/usr/java/j2sdk1.4.2_12

export JAVA_HOME=/usr/lib/java/jdk1.5.0_11

#Path Variable

export PATH=/usr/lib/java/jdk1.5.0_11/bin:$PATH

Jim Esler
Honored Contributor

Re: /bin/java: No such file or directory

What does this produce:

 

ls -l /usr/lib/java/jdk1.5.0_11/bin

Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

Can you also check this:

 

env|sort

 

You mentioned that you were setting the JAVA_HOME in the .profile, but if you are using bash, you should be setting it in .bash_profile.

ppm9
Regular Collector

Re: /bin/java: No such file or directory

ls -l /usr/lib/java/jdk1.5.0_11/bin
total 2860
-rwxr-xr-x  1 root root  62524 2006-12-15 06:41 appletviewer
-rwxr-xr-x  1 root root  62356 2006-12-15 06:08 apt
-rwxr-xr-x  1 root root   4153 2006-12-15 07:12 ControlPanel
-rwxr-xr-x  1 root root  62356 2006-12-15 06:55 extcheck
-rwxr-xr-x  1 root root   1080 2006-12-15 07:12 HtmlConverter
-rwxr-xr-x  1 root root  62356 2006-12-15 06:17 idlj
-rwxr-xr-x  1 root root  62324 2006-12-15 06:20 jar
-rwxr-xr-x  1 root root  62356 2006-12-15 06:19 jarsigner
-rwxr-xr-x  1 root root  65076 2006-12-15 06:06 java
-rwxr-xr-x  1 root root  62388 2006-12-15 06:06 javac
-rwxr-xr-x  1 root root  62356 2006-12-15 06:08 javadoc
-rwxr-xr-x  1 root root  62292 2006-12-15 06:09 javah
-rwxr-xr-x  1 root root  62324 2006-12-15 06:45 javap
-r-xr-xr-x  1 root root   1789 2006-12-15 06:43 java-rmi.cgi
-rwxr-xr-x  1 root root 175978 2006-12-15 07:12 javaws
-rwxr-xr-x  1 root root  62324 2006-12-15 06:47 jconsole
-rwxr-xr-x  1 root root  62356 2006-12-15 06:57 jdb
-rwxr-xr-x  1 root root  62420 2006-12-15 06:46 jinfo
-rwxr-xr-x  1 root root  62420 2006-12-15 06:46 jmap
-rwxr-xr-x  1 root root  62324 2006-12-15 06:46 jps
-rwxr-xr-x  1 root root  62356 2006-12-15 06:47 jsadebugd
-rwxr-xr-x  1 root root  62420 2006-12-15 06:47 jstack
-rwxr-xr-x  1 root root  62356 2006-12-15 06:46 jstat
-rwxr-xr-x  1 root root  62356 2006-12-15 06:46 jstatd
-rwxr-xr-x  1 root root  62356 2006-12-15 06:19 keytool
-rwxr-xr-x  1 root root  62388 2006-12-15 06:19 kinit
-rwxr-xr-x  1 root root  62388 2006-12-15 06:20 klist
-rwxr-xr-x  1 root root  62388 2006-12-15 06:20 ktab
-rwxr-xr-x  1 root root  62356 2006-12-15 06:45 native2ascii
-rwxr-xr-x  1 root root  62580 2006-12-15 06:49 orbd
-rwxr-xr-x  1 root root  62388 2006-12-15 06:51 pack200
-rwxr-xr-x  1 root root  62588 2006-12-15 06:19 policytool
-rwxr-xr-x  1 root root  62324 2006-12-15 06:42 rmic
-rwxr-xr-x  1 root root  62356 2006-12-15 06:43 rmid
-rwxr-xr-x  1 root root  62356 2006-12-15 06:43 rmiregistry
-rwxr-xr-x  1 root root  62356 2006-12-15 06:45 serialver
-rwxr-xr-x  1 root root  62356 2006-12-15 06:50 servertool
-rwxr-xr-x  1 root root  62580 2006-12-15 06:49 tnameserv
-rwxr-xr-x  1 root root 357373 2006-12-15 06:50 unpack200

 

ppm9
Regular Collector

Re: /bin/java: No such file or directory

env|sort
ACLOCAL_PATH=/opt/gnome/share/aclocal
COLORTERM=1
CPU=i686
GNOME2_PATH=/usr/local:/opt/gnome:/usr
HISTSIZE=1000
HOME=/home/hppm
HOST=
HOSTNAME=
HOSTTYPE=i386
INFODIR=/usr/local/info:/usr/share/info:/usr/info
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/opt/gnome/share/info
INPUTRC=/etc/inputrc
JAVA_HOME=/usr/lib/java/jdk1.5.0_11
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/u01/app/oracle/product/10.2/client/lib:/u01/app/oracle/product/                                                                                        10.2/client/network/lib:
LESS_ADVANCED_PREPROCESSOR=no
LESSCLOSE=lessclose.sh %s %s
LESSKEY=/etc/lesskey.bin
LESS=-M -I
LESSOPEN=lessopen.sh %s
LOGNAME=hppm
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:c                                                                                        d=40;33;01:or=40;31:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.b                                                                                        tm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31                                                                                        :*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31                                                                                        :*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=0                                                                                        1;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.                                                                                        mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;3                                                                                        5:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.aiff=00;32:*.au=00                                                                                        ;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:
LS_OPTIONS=-N --color=tty -T 0
MACHTYPE=i686-suse-linux
MAIL=/var/mail/hppm
MANPATH=/usr/local/man:/usr/share/man:/usr/X11R6/man:/opt/gnome/share/man
MINICOM=-c on
NNTPSERVER=news
no_proxy=localhost
OB=/u01/app/oracle
OE=/u01/app/oracle/product/10.2/client/bin
OH=/u01/app/oracle/product/10.2/client
ORACLE_BASE=/u01/app/oracle
ORACLE_EMCTL=/u01/app/oracle/product/10.2/client/bin
ORACLE_HOME=/u01/app/oracle/product/10.2/client
OSTYPE=linux
PAGER=less
PATH=/usr/lib/java/jdk1.5.0_11/bin:/u01/app/oracle/product/10.2/client/bin:/usr/                                                                                        bin:/usr/bin/X11:/usr/local/bin:/home/hppm/bin:/usr/local/bin:/usr/bin:/usr/X11R                                                                                        6/bin:/bin:/usr/games:/opt/gnome/bin
PKG_CONFIG_PATH=/opt/gnome/lib/pkgconfig
PROFILEREAD=true
PWD=/home/hppm
SHELL=/bin/bash
SHLVL=1
SSH_CLIENT=10.80.177.133 56442 22
SSH_CONNECTION=10.80.177.133 56442 10.80.88.82 22
SSH_TTY=/dev/pts/1
TERM=xterm
TEXINPUTS=:/home/hppm/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX
USER=hppm
_=/usr/bin/env
WINDOWMANAGER=/usr/X11R6/bin/kde
XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
XNLSPATH=/usr/X11R6/lib/X11/nls

 

Jason Nichols K
Honored Contributor

Re: /bin/java: No such file or directory

The way some of the replies to the commands trying to interpret the JAVA_HOME variable make me wonder if there aren't some hidden characters in there that don't display, but are passed to the different commands.

 

Try resetting the the JAVA_HOME variable from the current command line by manually typing

 

export JAVA_HOME=/usr/lib/java/jdk1.5.0_11

 

Then try to run

 

$JAVA_HOME/bin/java -version

//Add this to "OnDomLoad" event