• Post Reply Bookmark Topic Watch Topic
  • New Topic

jdk in linux  RSS feed

 
nesta fdb
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have come into some problems after i installed java in linux. In linux command line, i keyed in the order "java",it telled me that there's no command.Even if i try in the JAVA_HOME dir,i got the same problem. Would someone tell me why?
thanks
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12156
256
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!