Setting path

Hi all,

I have a java command in a shell script.
When i m executing the command from the prompt its working fine. But when i paste the same command in a shell script and execute the shell script it says path not found. Please help.

Try to use absolute path while you are trying to run the command thru shell script.

Hi,

But i dont want to use absolute path in my shell script as the folder structure may change

Can you show us then what you are putting in your script to run the command and the path of your command and shell script?

Are you running this script as a cron job?

Cause in that case you will have a very limited PATH definition and you will have to define PATH in the proper way.

Like sb008 said, set the PATH variable to point to the directory where the java executable is located. Then if the executable name is unique, it should be executed without issues. For more info search the forums.