LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   java and tomcat installation directory (https://www.linuxquestions.org/questions/linux-newbie-8/java-and-tomcat-installation-directory-4175494438/)

Whatif 02-10-2014 09:50 AM

java and tomcat installation directory
 
Hello,

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

sag47 02-10-2014 04:17 PM

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:

Code:

/app
├── 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....
Code:

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.

John VV 02-10-2014 05:21 PM

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
http://wiki.centos.org/
and the forum
https://www.centos.org/forums/

tomcat is in the repos

normally you would use yum to install a WEB BASED program like tomcat
Code:

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


or
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

Quote:

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


All times are GMT -5. The time now is 02:38 PM.