VectorLinux
September 30, 2014, 01:53:21 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [SOLVED] program not found in path  (Read 2752 times)
Verlager
Member
*
Posts: 34


« on: June 22, 2007, 01:20:44 pm »

ooops!

This works:
root:# /usr/lib/jre1.6.0_01/bin/java -version
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

root:# $PATH
bash: /usr/local/bin:/usr/bin:/usr/sbin:/bin:/opt/bin:/usr/X11/bin:/usr/local/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/qt/bin:/opt/seamonkey/bin:/usr/local/sbin:/usr/sbin:/sbin: No such file or directory

Seeing as /usr/local/bin is pathed, it makes sense to create a link from there to java:

root:# ls -l /usr/local/bin/java
lrwxrwxrwx 1 root root 29 2007-06-22 16:59 /usr/local/bin/java -> /usr/lib/jre1.6.0_01/bin/java*

But, when I type 'java -version', I get an error:

root:# java -version
bash: /usr/lib/java/bin/java: No such file or directory

Why is this? Maybe I inadvertently deleted a file? How can be sure that I am using the 1.6 java rather than the 1.5 java? Why isn't the link I created picked up on the CLI when it's clearly in the PATH?
« Last Edit: June 22, 2007, 02:53:59 pm by Verlager » Logged

Fear believes; courage doubts. Fear falls upon the earth and prays; courage stands erect and thinks. Fear retreats; courage advances. Fear is barbarism; courage is civilization. Fear believes in witchcraft, in devils and in ghosts. Fear is religion, courage is science. —Robert Ingersoll
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #1 on: June 22, 2007, 01:47:45 pm »

Type 'which java'. What comes up?
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Verlager
Member
*
Posts: 34


« Reply #2 on: June 22, 2007, 01:57:41 pm »

root:# which java
/usr/local/bin/java

 but:

root:#  which -a java
/usr/local/bin/java
/usr/bin/java
« Last Edit: June 22, 2007, 01:59:47 pm by Verlager » Logged

Fear believes; courage doubts. Fear falls upon the earth and prays; courage stands erect and thinks. Fear retreats; courage advances. Fear is barbarism; courage is civilization. Fear believes in witchcraft, in devils and in ghosts. Fear is religion, courage is science. —Robert Ingersoll
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #3 on: June 22, 2007, 02:02:52 pm »

Ah, that might explain it. What kind of file is /usr/bin/java? Also a link, or something else?

In any case, if the JRE binary directory already sits in your $PATH, I don't see why you need to add any links to it.
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Verlager
Member
*
Posts: 34


« Reply #4 on: June 22, 2007, 02:15:42 pm »

root:# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 29 2007-06-22 16:37 /usr/bin/java -> /usr/lib/jre1.6.0_01/bin/java*
Logged

Fear believes; courage doubts. Fear falls upon the earth and prays; courage stands erect and thinks. Fear retreats; courage advances. Fear is barbarism; courage is civilization. Fear believes in witchcraft, in devils and in ghosts. Fear is religion, courage is science. —Robert Ingersoll
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #5 on: June 22, 2007, 02:17:53 pm »

Hmm...

Is $JAVA_HOME set?
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Verlager
Member
*
Posts: 34


« Reply #6 on: June 22, 2007, 02:31:38 pm »

root:# $JAVA_HOME
bash: /usr/lib/java: No such file or directory
Logged

Fear believes; courage doubts. Fear falls upon the earth and prays; courage stands erect and thinks. Fear retreats; courage advances. Fear is barbarism; courage is civilization. Fear believes in witchcraft, in devils and in ghosts. Fear is religion, courage is science. —Robert Ingersoll
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #7 on: June 22, 2007, 02:43:02 pm »

Bingo...how did you install the JRE? Your setup looks to be buggered.

Anyway, try typing

export JAVA_HOME=/usr/lib/jre1.6.0_01

and see if you can run Java. It's not a permanent solution, however, and we shall have to find out what's wrong with your kit.
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Verlager
Member
*
Posts: 34


« Reply #8 on: June 22, 2007, 02:53:37 pm »

Excellent! It worked perfectly. Thank you so much!
Logged

Fear believes; courage doubts. Fear falls upon the earth and prays; courage stands erect and thinks. Fear retreats; courage advances. Fear is barbarism; courage is civilization. Fear believes in witchcraft, in devils and in ghosts. Fear is religion, courage is science. —Robert Ingersoll
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #9 on: June 22, 2007, 02:55:48 pm »

You still probably want to fix that Java installation. It looks like you installed a recent JRE version yourself. Did you add an appropriate /etc/profile.d/jre.sh?
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Verlager
Member
*
Posts: 34


« Reply #10 on: June 22, 2007, 03:25:14 pm »

To install java I did:

chmod a+x JRE-6u1-linux-i586.bin
mv jre1.6.0_01 /usr/lib


This seemed OK, because there is another similar directory, /usr/lib/jre1.5.0_09 at the same level. Now all I have to do (or so I thought) was to change the link to /usr/lib/jre15.0_09/bin/java and point it to the new /usr/lib/jre1.6.0_01/bin/java file. I've done it several times successfully in the past with ZW, the sister distro.

Yikes... no, I haven't edited the /etc/profile.d/jre.sh.

(original)

#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="$MANPATH:/usr/lib/java/man"
export PATH="$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin"

(proposed changes)

#!/bin/sh
export JAVA_HOME=/usr/lib/jre1.6.0_01
export MANPATH="$MANPATH:/usr/lib/java/man"
export PATH="$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin"

Should lines 3-4 also be edited?


Logged

Fear believes; courage doubts. Fear falls upon the earth and prays; courage stands erect and thinks. Fear retreats; courage advances. Fear is barbarism; courage is civilization. Fear believes in witchcraft, in devils and in ghosts. Fear is religion, courage is science. —Robert Ingersoll
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #11 on: June 22, 2007, 03:38:32 pm »

You have two JREs installed, the distro default and your own. That's OK I guess, as long as you're careful about how you set it up. The profile script should read:

Code:
#!/bin/sh
export JAVA_HOME=/usr/lib/jre1.6.0_01
export MANPATH="$MANPATH:$JAVA_HOME/man"
export PATH="$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin"

Try that.
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Verlager
Member
*
Posts: 34


« Reply #12 on: June 22, 2007, 04:51:19 pm »

Done!
Logged

Fear believes; courage doubts. Fear falls upon the earth and prays; courage stands erect and thinks. Fear retreats; courage advances. Fear is barbarism; courage is civilization. Fear believes in witchcraft, in devils and in ghosts. Fear is religion, courage is science. —Robert Ingersoll
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!