Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-10-2014, 10:50 AM   #1
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Rep: Reputation: 0
java and tomcat installation directory


I recently installed Cento 6.5 on a laptop that doesn't have access to the internet. I'll be using this computer to learn servlet and jsp. Where should I install the java rpm and unpack tomcat's .tar.gz? I searched online and it's suggested that if I'm a root user, I should install in /usr/local. If not, then under user's home directory. Shouldn't it be installed in the bin dir? What is the best location to install both java jdk and tomcat?

Thank you
Old 02-10-2014, 05:17 PM   #2
Senior Member
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,850
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
Apples and oranges. Different strokes for different folks. In my institution, we have a dedicated apps partition mounted under /app that is a separate mountpoint from the rest of the system.

From there I tend to do the following:

├── apache-tomcat-7.0.41
├── java -> jdk1.7.0_25
├── jdk1.7.0_25
├── tomcat -> apache-tomcat-7.0.41
Btw /app/java and /app/tomcat are sym links.

And then in /etc/profile things like....
export JAVA_HOME="/app/java"
export JAVA_OPTS="-Xms512m -Xmx3072m -XX:MaxPermSize=256m -Djava.awt.headless=true"
export TOMCAT_HOME="/app/tomcat"
export PATH="/app/java/bin:${PATH}"
Note: for production systems it's best to set -Xms and -Xmx to the same values for performance reasons. Your values may be different so it is best to refer to garbage collection tuning if you need to.

So on and so forth. I also tend to use my own init.d scripts. You can even modify the MANPATH (/etc/manpath.config or ~/.manpath) so that it uses the man pages at /app/java/man. Some people choose /usr/local because it is outside of package management. Some people choose /opt. Some even strictly stick to packages or package their own RPMs from binaries. It really depends on what your requirements are. If you have no requirements then make a decision and do it.

Last edited by sag47; 02-10-2014 at 05:22 PM.
Old 02-10-2014, 06:21 PM   #3
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,225

Rep: Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521
java from the install dvd is already installed
cent is using Icetea , so OpenJDK1.7 is already installed ( and openjdk 1.6 can also be installed if needed)

you might want to go through the CentOS wiki
and the forum

tomcat is in the repos

normally you would use yum to install a WEB BASED program like tomcat
su -
yum search tomcat
but for offline install

make a CLONE of the offline set up
install that cloned image on a machine with internet access
and use that and the "yum-download" plugin to get all the needed Prerequsits

one at a time
try to install the rpm OFFLINE and see what is missing
then on a ONLINE machine find the missing rpm's -- the CORRECT AND NOT INCOMPATIBLE VERSION !!!!!!
( from the correct mirror !!!! )
some third party repos are still incompatible with updates or other third party repos
copy that rpm to a cd/usb thumb
and repeat

expect that to take a full day for a 2 minute job

I should install in /usr/local.
NO, cent/rhel dose not use that location by default
you can but you have to export that location

cent/RHEL uses /usr

Debian uses /usr/local

so not CentOS 6.5 install to /usr rpm's will mostly already install to there

Last edited by John VV; 02-10-2014 at 06:28 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solaris/Tomcat/Java techM Solaris / OpenSolaris 9 06-03-2010 12:37 PM
Regarding installation of Java Servlets, JSP, Jakarta-Tomcat on centos5 vamsi_k Linux - Newbie 3 10-20-2008 01:28 AM
tomcat or java mahmoud Linux - Software 3 10-02-2008 04:48 AM
Java, apache, tomcat @ngelot Linux - Software 0 11-03-2005 06:55 AM
java ant tomcat j-ray Linux - Software 1 09-12-2002 12:59 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration