• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

jdk in linux

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic