• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAVA_HOME & TOMCAT_HOME  RSS feed

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am a novice in Linux platform. i am trying to intall Jakart-Tomcat in my Linux 7.2 box but couldn't set the Environment Variables. i did find some articles on it but couldn't get any help from them. i would appreciate if anyone could explain me the steps in layman's term to set these variables.thanks.
himal
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the many questions posted in this forum about setting environment variables ? If not, please do so. The answer to your problem may be here already.
If you have already looked here, please explain in a bit more detail which variables you want to set, and what you have tried so far which has not worked.
 
Himal Chuli
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks frank for you reply. here is what i've done:
i installed jakarta-tomcat-4.0.4.tar and j2sdk-1_4_0_01-linux-i586-rpm. there are installed in /usr/local/jakarta-tomcat-4.0.4 and /usr/java/j2sdk1.4.0_01 directory. when i got in /usr/java/j2sdk1.4.0_01/bin and typed javac, the following pops up.
bash: javac: command not found
similarly, when i got in /usr/local/jakarta-tomcat-4.0.4/bin and typed startup.sh to get tomcat running, the following popps up:
bash: startup.sh: command not found
i believe that i need to set env variables for these. as people suggested in this forum, i need to set env in bash and profile, but as said, i am a novice linux user, i don't even know how to get into these bash and profile shells (that's what's called in Linux world) and how to get out from these shells.
i would appcreciate if you please again explain me about it in simple way. i know explaining these would be pain in the butt.. but i need help.
thanks.
himal
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, to make sure you have things installed properly, go to /usr/java/j2sdk1.4.0_01/bin and type
./java -version
Note that the period and slash are important. This should run and tell you the vesrion of the "java" command. If this works, you just need to add this directory to your execution path, which I shall explain later. If it doesn't work, you should take another look at the installation instructions which came with the Java SDK.
To add a directory to your path type the following (making sure that all the punctuation is exactly the same)
echo 'PATH=$PATH:/usr/java/j2sdk1.4.0_01/bin' >> ~/.bash_profile
then log out and log back in again as the same user and type
echo $PATH
You should see that it now contains the java "bin" directory, and you should now be able to type "java -version" from anywhere.
Let us know how you get on.
 
Himal Chuli
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi frank,
did everything as you said to do and works great. went in root and set the PATH things, works fine. wondering if i must be in root directory to set this PATH or could do it from anywhere.
now, the next thing is, how do i set env for jakarta-tomcat so that i can start tomcat from anywhere? waiting for your reply. appreciate your help.
thanks.
himal
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you could add it to your /etc/profile. if you've never used *any* of the editors that could be a challenge but basically if pico is installed you may want to do this. 'pico /etc/profile' or you can added it to your bash_profile (this will only make it available to the user that you are signed in as). If pico is *not* on your machine you can always use vi but you'd want to run though vi's tutorial before trying to use it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!