posted 22 years ago
Probably you have not set your executable path?
At the shell prompt, type: "<code>echo $PATH</code>" and take a look at the result. Do you see the equivelent of ${JAVA_HOME}/bin?
On my system, I get:
<code><pre>
[andrewm@andrewm andrewm]$ echo $JAVA_HOME
/usr/java/j2sdk1.4.0_01
[andrewm@andrewm andrewm]$ echo $PATH
/usr/X11R6/bin:/usr/local/bin:/bin:/usr/bin:/usr/java/j2sdk1.4.0_01/bin:/opt/jakarta-ant-1.4.1/bin:
/oracle/OraHome1/bin:/usr/java/j2sdk1.4.0_01/bin:/opt/jakarta-ant-1.4.1/bin:/home/andrewm/bin
</pre></code>
Since my JAVA_HOME is set to /usr/java/j2sdk1.4.0_01, I expect to find /usr/java/j2sdk1.4.0_01/bin in my PATH (and yes, it is in there).
You need to edit the profile script you run at login. This may be ~/.bash_profile if you are running bash. Add a line in it somewhere like (for bash):
<code></pre> export PATH=$PATH:${JAVA_HOME}/bin</pre></code>
(assuming you have JAVA_HOME set ... if no, type out the complete path).
JAVA_HOME is not necessary for running Java programs, however it makes add on applications (especially "ant" and "tomcat") work much easier.
If you want to set it up for all users, then you need to modify the appropriate file(s) under /etc/profile.d/ (if you have if) or the appropriate profile in /etc
Regards, Andrew
[ May 18, 2003: Message edited by: Andrew Monkhouse ]