Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-08-2010, 05:14 AM   #1
LQ Newbie
Registered: Jun 2010
Posts: 3

Rep: Reputation: 0
Question how to install java and tomcat to CentOS release 5.4

hi there,


I'm a mid-level user on linux desktop but a noob admin on CentOS Server. Haven't installed much stuff -- Thanks in advance for helping.

Got a godaddy Virtual Dedicated Server(VDS), which is a VPS that runs CentOS release 5.4.

It already has java 6.0(OpenJDK) installed in /usr/bin/java. I would like to upgrade or install another version of java (sun's JDK 6.0_20) and apache tomcat 6.0.26 application server ( I don't mind using OpenJDK but I prefer Sun's JDK since it's more stable and works better.

I have ssh access to this CentOS server. Can someone help me
a) download sun's JDK (
b) download tomcat for linux (
c) install java
d) install tomcat

Once I do that I'd like tomcat to run as a daemon. From previous experience, I know that we create a script in /etc/init or /etc/init.d/ directory. This script helps in starting/stopping and restarting tomcat.

Also, how do I get and install midnight commander (the file manager) ?

I'll be glad to help you help me,

Thank you so much,

Old 06-08-2010, 05:30 AM   #2
LQ Newbie
Registered: Jun 2010
Posts: 3

Original Poster
Rep: Reputation: 0
downloaded sun's java but have trouble installing it

hi all,

thanks for your responses.

I went ahead and downloaded java and tomcat using following commands
a) wget
b) wget

After downloading the above, I started installing java.

$ chmod +x jdk-6u20-linux-i586-rpm.bin
$ ./jdk-6u20-linux-i586-rpm.bin

UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (
inflating: jdk-6u20-linux-i586.rpm
inflating: sun-javadb-common-10.5.3-0.2.i386.rpm
inflating: sun-javadb-core-10.5.3-0.2.i386.rpm
inflating: sun-javadb-client-10.5.3-0.2.i386.rpm
inflating: sun-javadb-demo-10.5.3-0.2.i386.rpm
inflating: sun-javadb-docs-10.5.3-0.2.i386.rpm
inflating: sun-javadb-javadoc-10.5.3-0.2.i386.rpm
error: can't create transaction lock on /var/lib/rpm/__db.000
Installing JavaDB
error: can't create transaction lock on /var/lib/rpm/__db.000

[temp]$ sudo ./jdk-6u20-linux-i586-rpm.bin

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

vhosting is not in the sudoers file. This incident will be reported.
audit_log_user_command(): Connection refused
[ temp]$

What did I do wrong ? How do I go about installing Java (and tomcat) ?

thank you,

Old 06-08-2010, 07:22 AM   #3
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2015, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 15,914

Rep: Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024Reputation: 3024
No 'sudo' by default on CentOS ? Unless you set it up.

The most easy way to install Sun java jdk on CentOS 5.4 :
Use the "all in one" rpm package :
>>> jdk-1.6.0_20-fcs.i586.rpm
.. Then everything will usually be configured automatically.

Install with : 1) su
2) rpm -Uvh jdk-1.6.0_20-fcs.i586.rpm

You can of course use the packages, you already unpacked,
but you will then have to manually configure the links.
> Post #2.

Tomcat , probably ..
# yum install tomcat5 tomcat5-jsp tomcat5-servlet
And # yum search tomcat
.. to see all available tomcat packages.
.. And welcome to LQ. .. ..

Last edited by knudfl; 06-23-2010 at 05:11 PM.
Old 06-11-2010, 04:49 AM   #4
LQ Newbie
Registered: Jun 2010
Posts: 3

Original Poster
Rep: Reputation: 0
that works!

knudfl : thank you. that works.

yum and apg-get : I am learning to use them regularly.

Old 06-11-2010, 09:21 AM   #5
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,291

Rep: Reputation: 102Reputation: 102
See this


centos5, install, java, tomcat6

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
java install help (heading towards tomcat) twistedrhymes Ubuntu 4 08-16-2010 12:55 PM
uable to install Xerox phaser3121 in CentOS release 5.2 Manohart24 Linux - Newbie 1 05-26-2009 08:06 PM
JAVA SDK install on CentOS CY83R-R0N1N Linux - Newbie 3 05-25-2006 12:17 AM
how to install java & tomcat server in linux adityakumar Linux - Software 2 06-04-2005 11:51 PM
install Java (Servlet), Tomcat on Fedora need help. learn Fedora 2 02-25-2004 12:28 AM

All times are GMT -5. The time now is 04:18 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