Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running Ubuntu 12.04.2 LTS and am having problems with getting a command to execute. I have set up the variable in /etc/environment which looks like this:

FEDORA_HOME="/var/lib/fedora"
CATALINA_HOME="/var/lib/tomcat6"
ORACLE_HOME="/usr/lib/oracle/11.2/client64"
JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m - Djavax.net.ssl.trustStore=/usr/local/fedora/truststore -Djavax.net.ssl.trustStorePassword=tomcat"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$FEDORA_HOME/server:$FEDORA_HOME/client/bin:$ORACLE_HOME:$ORACLE_HOME/bin"

The issue is with the $ORACLE_HOME in the PATH variable. I can cd to the correct directory using:

cd $ORACLE_HOME/bin

But when I try to run sqlplus (the program I am having problems with), the system can't find it. And before anyone asks, yes I have rebooted the system and the file sqlplus does exist in $ORACLE_HOME/bin and is executable by everyone.

This should work, but obviously isn't. Any ideas as to what the issue might be? It is like it doesn't exist in the path although it is clearly there. I can't figure this out. Please help!

Thanks

share|improve this question

migrated from stackoverflow.com Mar 21 '13 at 7:58

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

up vote 0 down vote accepted

The Ubuntu docs say that the environment file isn't a script file, so it may not be interpreting your $ORACLE_HOME variable the way you hope. Run env to see what your path looks like. If it isn't what you expect, try hard coding the full path in /etc/environment and see if that helps.

share|improve this answer
    
Hard coding the path worked! Thanks. I thought you could put in variable names into the path as I have seen numerous how to manuals that say to do that. –  user5013 Mar 21 '13 at 15:55
    
If you edit your ~/.profile instead of your etc/environment, then you can use variables. However, the path will only be set for your user. If this answer helped you, please consider accepting it. –  kjw0188 Mar 21 '13 at 17:35
add comment

There are two probable reasons:
1) $PATH isn't set
2) There's conflicting sqlplus earlier in the PATH.

To make sure path is set, run echo $PATH from console. It should print /usr/lib/oracle/11.2/client64 among other paths.

Also I recommend to put $ORACLE_HOME:$ORACLE_HOME/bin before other paths.

If nothing works, make sure sqlplus is directly runnable:
cd /usr/lib/oracle/11.2/client64
./sqlplus
Maybe it's a script pointing to non-existent shell?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.