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:

JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m - Djavax.net.ssl.trustStore=/usr/local/fedora/truststore -Djavax.net.ssl.trustStorePassword=tomcat"

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


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!


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

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

  • You cannot use variables in /etc/environment. – wisbucky Apr 18 at 16:54

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.

  • 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

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
Maybe it's a script pointing to non-existent shell?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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