How to Install Java in CentOS 6.3


Install Java in CentOS

Create a Local Repository for CentOS by using existing packages on Distribution Media or make sure that Internet is accessible from the virtual machine

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers

List of all available JDK on the system

[root@localhost ~]# yum search java | grep -i –color JDK
ldapjdk-javadoc.x86_64 : Javadoc for ldapjdk
icedtea-web.x86_64 : Additional Java components for OpenJDK – Java browser
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
ldapjdk.x86_64 : The Mozilla LDAP Java SDK

[root@localhost ~]# yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centosmirror.go4hosting.in
* extras: centosmirror.go4hosting.in
* updates: centosmirror.go4hosting.in
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package java-1.7.0-openjdk.x86_64 1:1.7.0.55-2.4.7.1.el6_5 will be installe                                                                                        d
–> Processing Dependency: jpackage-utils >= 1.7.3-1jpp.2 for package: 1:java-1.                                                                                        7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64
–> Processing Dependency: xorg-x11-fonts-Type1 for package: 1:java-1.7.0-openjd                                                                                        k-1.7.0.55-2.4.7.1.el6_5.x86_64
–> Processing Dependency: tzdata-java for package: 1:java-1.7.0-openjdk-1.7.0.5                                                                                        5-2.4.7.1.el6_5.x86_64
–> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: 1:java                                                                                        -1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64
–> Processing Dependency: libgif.so.4()(64bit) for package: 1:java-1.7.0-openjd                                                                                        k-1.7.0.55-2.4.7.1.el6_5.x86_64
—> Package java-1.7.0-openjdk-devel.x86_64 1:1.7.0.55-2.4.7.1.el6_5 will be in                                                                                        stalled
–> Running transaction check
—> Package giflib.x86_64 0:4.1.6-3.1.el6 will be installed
—> Package jpackage-utils.noarch 0:1.7.5-3.12.el6 will be installed
—> Package libjpeg.x86_64 0:6b-46.el6 will be obsoleted
—> Package libjpeg-turbo.x86_64 0:1.2.1-3.el6_5 will be obsoleting
—> Package tzdata-java.noarch 0:2014b-1.el6 will be installed
—> Package xorg-x11-fonts-Type1.noarch 0:7.2-9.1.el6 will be installed
–> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-9.1.el                                                                                        6.noarch
–> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-9.1.el                                                                                        6.noarch
–> Running transaction check
—> Package ttmkfdir.x86_64 0:3.0.9-32.1.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package                    Arch     Version                    Repository
Size
================================================================================
Installing:
java-1.7.0-openjdk         x86_64   1:1.7.0.55-2.4.7.1.el6_5   updates    26 M
java-1.7.0-openjdk-devel   x86_64   1:1.7.0.55-2.4.7.1.el6_5   updates   9.4 M
libjpeg-turbo              x86_64   1.2.1-3.el6_5              updates   174 k
replacing  libjpeg.x86_64 6b-46.el6
Installing for dependencies:
giflib                     x86_64   4.1.6-3.1.el6              base       37 k
jpackage-utils             noarch   1.7.5-3.12.el6             base       59 k
ttmkfdir                   x86_64   3.0.9-32.1.el6             base       43 k
tzdata-java                noarch   2014b-1.el6                updates   147 k
xorg-x11-fonts-Type1       noarch   7.2-9.1.el6                base      520 k

Transaction Summary
================================================================================
Install       8 Package(s)

Total download size: 36 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): giflib-4.1.6-3.1.el6.x86_64.rpm                   |  37 kB     00:01
(2/8): java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64. |  26 MB     18:30
(3/8): java-1.7.0-openjdk-devel-1.7.0.55-2.4.7.1.el6_5.x86_64.rpm                                                                                | 9.4 MB     07:02
(4/8): jpackage-utils-1.7.5-3.12.el6.noarch.rpm                                                                                                  |  59 kB     00:00
(5/8): libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm                                                                                                    | 174 kB     00:09
(6/8): ttmkfdir-3.0.9-32.1.el6.x86_64.rpm                                                                                                        |  43 kB     00:01
(7/8): tzdata-java-2014b-1.el6.noarch.rpm                                                                                                        | 147 kB     00:05
(8/8): xorg-x11-fonts-Type1-7.2-9.1.el6.noarch.rpm                                                                                               | 520 kB     00:16
————————————————————————————————————————————————————————
Total                                                                                                                                    23 kB/s |  36 MB     26:19
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : jpackage-utils-1.7.5-3.12.el6.noarch                                                                                                                 1/9
Installing : giflib-4.1.6-3.1.el6.x86_64                                                                                                                          2/9
Installing : libjpeg-turbo-1.2.1-3.el6_5.x86_64                                                                                                                   3/9
Installing : tzdata-java-2014b-1.el6.noarch                                                                                                                       4/9
Installing : ttmkfdir-3.0.9-32.1.el6.x86_64                                                                                                                       5/9
Installing : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                                                                                                              6/9
Installing : 1:java-1.7.0-openjdk-devel-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                             7/9
Installing : 1:java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                                   8/9
Erasing    : libjpeg-6b-46.el6.x86_64                                                                                                                             9/9
Verifying  : ttmkfdir-3.0.9-32.1.el6.x86_64                                                                                                                       1/9
Verifying  : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                                                                                                              2/9
Verifying  : 1:java-1.7.0-openjdk-devel-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                             3/9
Verifying  : tzdata-java-2014b-1.el6.noarch                                                                                                                       4/9
Verifying  : libjpeg-turbo-1.2.1-3.el6_5.x86_64                                                                                                                   5/9
Verifying  : giflib-4.1.6-3.1.el6.x86_64                                                                                                                          6/9
Verifying  : 1:java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                                   7/9
Verifying  : jpackage-utils-1.7.5-3.12.el6.noarch                                                                                                                 8/9
Verifying  : libjpeg-6b-46.el6.x86_64                                                                                                                             9/9

Installed:
java-1.7.0-openjdk.x86_64 1:1.7.0.55-2.4.7.1.el6_5        java-1.7.0-openjdk-devel.x86_64 1:1.7.0.55-2.4.7.1.el6_5        libjpeg-turbo.x86_64 0:1.2.1-3.el6_5

Dependency Installed:
giflib.x86_64 0:4.1.6-3.1.el6                  jpackage-utils.noarch 0:1.7.5-3.12.el6      ttmkfdir.x86_64 0:3.0.9-32.1.el6      tzdata-java.noarch 0:2014b-1.el6
xorg-x11-fonts-Type1.noarch 0:7.2-9.1.el6

Replaced:
libjpeg.x86_64 0:6b-46.el6

Complete!
You have mail in /var/spool/mail/root
[root@localhost ~]#

RHEL and CentOS Linux install OpenJDK into /usr/lib/jvm/ directory

Set the JAVA_HOME class path variable

export JAVA_HOME="/usr/lib/jvm/jre-1.7.0-openjdk.x86_64

 

Advertisements

Create a keystore in Java


How to Create a keystore in Java to store private key and self-signed certificate

Java – Download Free EBooks and Whitepapers

C:Usersadmin>“C:Program FilesJavajdk1.8.0″binkeytool -genkey -alias tomca
t -keyalg RSA

 

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers

Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]:  Mitesh Soni
What is the name of your organizational unit?
[Unknown]:  iGATE
What is the name of your organization?
[Unknown]:  iGATE
What is the name of your City or Locality?
[Unknown]:  Gnagar
What is the name of your State or Province?
[Unknown]:  Gu
What is the two-letter country code for this unit?
[Unknown]:  IN
Is CN=Mitesh Soni, OU=iGATE, O=iGATE, L=Gnagar, ST=Gu, C=IN correct?
[no]:
What is your first and last name?
[Mitesh Soni]:
What is the name of your organizational unit?
[iGATE]:
What is the name of your organization?
[iGATE]:
What is the name of your City or Locality?
[Gnagar]:
What is the name of your State or Province?
[Gu]:
What is the two-letter country code for this unit?
[IN]:
Is CN=Mitesh Soni, OU=iGATE, O=iGATE, L=Gnagar, ST=Gu, C=IN correct?
[no]:  yes

Enter key password for <tomcat>
(RETURN if same as keystore password):

This information will be displayed to users who attempt to access a secure page in your application, so make sure that the information provided here matches what they will expect.

The keytool prompt will tell you that pressing the ENTER key automatically uses the same password for the key as the keystore. If you select a different password to the keystore password, you will also need to specify the custom password in the server.xml configuration file.

 

This command will create a new file, in the home directory of the user under which you run it, named “.keystore“.

 

Deploy Web Application in Tomcat 8


Deploy Web Application in Tomcat 8 on Windows 8 with Java 8

Now Download sample application from: http://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/

Copy that WAR file into the webapps folder of Tomcat Installation directory

Java – Download Free EBooks and Whitepapers

Verify Console after 1-2 minutes and you will find Message such as:

18-Nov-2013 23:50:18.380 INFO [localhost-startStop-2] org.apache.catalina.startu
p.HostConfig.deployWAR Deploying web application archive C:F Drive-IMPSetupAp
ache Tomcatapache-tomcat-8.0.0-RC5-windows-x64apache-tomcat-8.0.0-RC5webapps
sample.war

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers

Let’s visit that sample application

Web application Deployment in Tomcat 8
Web application Deployment in Tomcat 8

Done

How to install Tomcat 8 on Windows 8 with Java 8


To install Tomcat 8 -> Install Java 8 on Windows 8

Download Tomcat 8

Open Tomcat Home Directory

These are some of the key tomcat directories:

  • /bin – Startup, shutdown, and other scripts. The *.sh files (for Unix systems) are functional duplicates of the *.bat files (for Windows systems). Since the Win32 command-line lacks certain functionality, there are some additional files in here.
  • /conf – Configuration files and related DTDs. The most important file in here is server.xml. It is the main configuration file for the container.
  • /logs – Log files are here by default.
  • /webapps – This is where your webapps go.

Open Command Prompt and run startup.bat from Tomcat Home

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers
Tomcat 8
Tomcat 8

Java – Download Free EBooks and Whitepapers

Once Tomcat is started successfully, It will display message on console similar to:

18-Nov-2013 23:36:47.995 INFO [main] org.apache.catalina.startup.Catalina.start
Server startup in 4119 ms

Verify the Tomcat Home Page

Tomcat 8
Tomcat 8

Done.

 

 

 

Install Tomcat 6 in CentOS 6.3


1) Install CentOS 6.3 -> How to install CentOS 6.3 ;

2) Create a Local Yum Repository in CentOS 6.3 -> Create a Local Yum Repository in CentOS 6.3 in 5 steps

3) Run yum install tomcat6 and Tomcat will be installed!!! Done!!!

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers

[root@localhost ~]# yum install tomcat6

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds
from cached hostfile

Setting up Install Process

Resolving Dependencies

–> Running transaction check

—> Package
tomcat6.noarch 0:6.0.24-45.el6 will be installed

base/filelists
| 4.4 MB00:01

–> Processing Dependency: tomcat6-lib = 6.0.24-45.el6 for package:tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: mx4j for package: tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: log4j for package: tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: log4j for package: tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: jakarta-commons-pool for package: tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: jakarta-commons-logging for package: tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: jakarta-commons-dbcp for package: tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: jakarta-commons-daemon for package: tomcat6-6.0.24-45.el6.noarch

–> Processing Dependency: jakarta-commons-collections for package: tomcat6-6.0.24-45.el6.noarch

–> Running transaction check

—> Package jakarta-commons-collections.noarch 0:3.2.1-3.4.el6 will be installed

—> Package jakarta-commons-daemon.i686 1:1.0.1-8.9.el6 will be installed

–> Processing Dependency: libgcj_bc.so.1 for package: 1:jakarta-commons-daemon-1.0.1-8.9.el6.i686

–> Processing Dependency: java-gcjcompat for package: 1:jakarta-commons-daemon-1.0.1-8.9.el6.i686

–> Processing Dependency: java-gcjcompat for package: 1:jakarta-commons-daemon-1.0.1-8.9.el6.i686

—> Package jakarta-commons-dbcp.noarch 0:1.2.1-13.8.el6 will be installed

—> Package jakarta-commons-logging.noarch 0:1.0.4-10.el6 will be installed

—> Package jakarta-commons-pool.i686 0:1.3-12.7.el6 will be installed

—> Package log4j.i686 0:1.2.14-6.4.el6 will be installed

–> Processing Dependency: xml-commons-apis for package: log4j-1.2.14-6.4.el6.i686

—> Package mx4j.noarch 1:3.0.1-9.13.el6 will be installed

–> Processing Dependency: javamail >= 1.2-5jpp for package: 1:mx4j-3.0.1-9.13.el6.noarch

–> Processing Dependency: bcel >= 5.0 for package: 1:mx4j-3.0.1-9.13.el6.noarch

–> Processing Dependency: axis >= 1.1 for package: 1:mx4j-3.0.1-9.13.el6.noarch

–> Processing Dependency: xml-commons-resolver for package: 1:mx4j-3.0.1-9.13.el6.noarch

–> Processing Dependency: jaf for package: 1:mx4j-3.0.1-9.13.el6.noarch

—> Package tomcat6-lib.noarch 0:6.0.24-45.el6 will be installed

–> Processing Dependency: tomcat6-servlet-2.5-api = 6.0.24-45.el6 for package: tomcat6-lib-6.0.24-45.el6.noarch

–> Processing Dependency: tomcat6-jsp-2.1-api = 6.0.24-45.el6 for package: tomcat6-lib-6.0.24-45.el6.noarch

–> Processing Dependency: tomcat6-el-2.1-api = 6.0.24-45.el6 for package: tomcat6-lib-6.0.24-45.el6.noarch

–> Processing Dependency: ecj for package: tomcat6-lib-6.0.24-45.el6.noarch

–> Running transaction check

—> Package axis.noarch 0:1.2.1-7.2.el6 will be installed

–> Processing Dependency: wsdl4j for package: axis-1.2.1-7.2.el6.noarch

–> Processing Dependency: jakarta-commons-httpclient for package: axis-1.2.1-7.2.el6.noarch

–> Processing Dependency: jakarta-commons-discovery for package: axis-1.2.1-7.2.el6.noarch

—> Package bcel.i686 0:5.2-7.2.el6 will be installed

–> Processing Dependency: regexp for package: bcel-5.2-7.2.el6.i686

—> Package classpathx-jaf.i686 0:1.0-15.4.el6 will be installed

—> Package classpathx-mail.noarch 0:1.1.1-9.4.el6 will be installed

—> Package ecj.i686 1:3.4.2-6.el6 will be installed

—> Package java-1.5.0-gcj.i686 0:1.5.0.0-29.1.el6 will be installed

–> Processing Dependency: sinjdoc for package: java-1.5.0-gcj-1.5.0.0-29.1.el6.i686

—> Package libgcj.i686 0:4.4.6-4.el6 will be installed

—> Package tomcat6-el-2.1-api.noarch 0:6.0.24-45.el6 will be installed

—> Package tomcat6-jsp-2.1-api.noarch 0:6.0.24-45.el6 will be installed

—> Package tomcat6-servlet-2.5-api.noarch 0:6.0.24-45.el6 will be installed

—> Package xml-commons-apis.i686 0:1.3.04-3.6.el6 will be installed

—> Package xml-commons-resolver.i686 0:1.1-4.18.el6 will be installed

–> Running transaction check

—> Package jakarta-commons-discovery.noarch

1:0.4-5.4.el6 will be installed

—> Package jakarta-commons-httpclient.i686 1:3.1-0.6.el6 will be installed

—> Package regexp.i686 0:1.5-4.4.el6 will be installed

—> Package sinjdoc.i686 0:0.5-9.1.el6 will be installed

–> Processing Dependency: java_cup >= 0.10 for package: sinjdoc-0.5-9.1.el6.i686

—> Package wsdl4j.noarch 0:1.5.2-7.8.el6 will be installed

–> Running transaction check

—> Package java_cup.i686 1:0.10k-5.el6 will be installed

–> Finished
Dependency Resolution

Dependencies Resolved

 

=================================================================================

PackageArchVersionRepositorySize

=================================================================================

Installing:

tomcat6noarch 6.0.24-45.el6 base87 k

Installing for dependencies:

axisnoarch 1.2.1-7.2.el6 base1.5 M

bceli6865.2-7.2.el6 base1.2 M

classpathxjafi6861.0-15.4.el6base92 k

classpathx-mailnoarch1.1.1-9.4.el6base479 k

ecj i6861:3.4.2-6.el6 base2.5 M

jakarta-commons-collections noarch3.2.1-3.4.el6base523 k

jakarta-commons-daemoni6861:1.0.1-8.9.el6base43 k

jakarta-commons-dbcpnoarch1.2.1-13.8.el6base116 k

jakarta-commons-discoverynoarch1:0.4-5.4.el6base73 k

jakarta-commons-httpclienti6861:3.1-0.6.el6base519 k

jakarta-commons-loggingnoarch1.0.4-10.el6base52 k

jakarta-commons-pooli6861.3-12.7.el6base110 k

java-1.5.0-gcji6861.5.0.0-29.1.el6base138 k

java_cupi6861:0.10k-5.el6base178 k

libgcji6864.4.6-4.el6base17 M

log4ji6861.2.14-6.4.el6base603 k

mx4jnoarch 1:3.0.1-9.13.el6 base1.1 M

regexpi6861.5-4.4.el6base97 k

sinjdoci6860.5-9.1.el6base646 k

tomcat6-el-2.1-apinoarch6.0.24-45.el6base43 k

tomcat6-jsp-2.1-apinoarch6.0.24-45.el6base80 k

tomcat6-libnoarch6.0.24-45.el6base2.8 M

tomcat6-servlet-2.5-apinoarch6.0.24-45.el6base94 k

wsdl4jnoarch1.5.2-7.8.el6base157 k

xml-commons-apisi6861.3.04-3.6.el6base388 k

xml-commons-resolveri6861.1-4.18.el6base128 k

 

Transaction Summary

==================================================================================

Install27 Package(s)

 

Total download size: 31 M

Installed size: 84 M

Is this ok [y/N]: y

Downloading Packages:

(1/27):axis-1.2.1-7.2.el6.noarch.rpm | 1.5 MB00:00

(2/27): bcel-5.2-7.2.el6.i686.rpm| 1.2 MB00:00

(3/27): classpathx-jaf-1.0-15.4.el6.i686.rpm |92 kB00:00

(4/27): classpathx-mail-1.1.1-9.4.el6.noarch.rpm| 479 kB00:00

(5/27): ecj-3.4.2-6.el6.i686.rpm | 2.5 MB00:04

(6/27): jakarta-commons-collections-3.2.1-3.4.el6.noarch.rpm| 523 kB 00:00

(7/27):jakarta-commons-daemon-1.0.1-8.9.el6.i686.rpm|43 kB00:00

(8/27): jakarta-commons-dbcp-1.2.1-13.8.el6.noarch.rpm | 116 kB 00:00

(9/27): jakarta-commons-discovery-0.4-5.4.el6.noarch.rpm|73 kB00:00

(10/27): jakarta-commons-httpclient-3.1-0.6.el6.i686.rpm| 519 kB 00:00

(11/27): jakarta-commons-logging-1.0.4-10.el6.noarch.rpm|52 kB00:00

(12/27): jakarta-commons-pool-1.3-12.7.el6.i686.rpm| 110 kB 00:00

(13/27): java-1.5.0-gcj-1.5.0.0-29.1.el6.i686.rpm| 138 kB 00:00

(14/27): java_cup-0.10k-5.el6.i686.rpm | 178 kB 00:00

(15/27): libgcj-4.4.6-4.el6.i686.rpm|17 MB00:10

(16/27): log4j-1.2.14-6.4.el6.i686.rpm| 603 kB 00:00

(17/27): mx4j-3.0.1-9.13.el6.noarch.rpm | 1.1 MB00:00

(18/27): regexp-1.5-4.4.el6.i686.rpm |97 kB00:00

(19/27): sinjdoc-0.5-9.1.el6.i686.rpm | 646 kB 00:00

(20/27): tomcat6-6.0.24-45.el6.noarch.rpm |87 kB00:00

(21/27): tomcat6-el-2.1-api-6.0.24-45.el6.noarch.rpm |43 kB00:00

(22/27): tomcat6-jsp-2.1-api-6.0.24-45.el6.noarch.rpm |80 kB00:00

(23/27): tomcat6-lib-6.0.24-45.el6.noarch.rpm | 2.8 MB00:02

(24/27): tomcat6-servlet-2.5-api-6.0.24-45.el6.noarch.rpm|94 kB00:00

(25/27): wsdl4j-1.5.2-7.8.el6.noarch.rpm| 157 kB 00:00

(26/27): xml-commons-apis-1.3.04-3.6.el6.i686.rpm| 388 kB 00:00

(27/27): xml-commons-resolver-1.1-4.18.el6.i686.rpm| 128 kB 00:00

—————————————————————————————————————————–

Total
1.4 MB/s |31

MB00:21

warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature,
key ID c105b9de: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Importing GPG key 0xC105B9DE:

Userid : CentOS-6 Key (CentOS 6 Official Signing Key)
<centos-6-key@centos.org>

Package:
centos-release-6-3.el6.centos.9.i686 (@anaconda-CentOS-201207051201.i386/6.3)

From: /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

 

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

Installing : jakarta-commons-logging-1.0.4-10.el6.noarch

1/27

Installing : jakarta-commons-collections-3.2.1-3.4.el6.noarch

2/27

Installing : tomcat6-servlet-2.5-api-6.0.24-45.el6.noarch

3/27

Installing : tomcat6-jsp-2.1-api-6.0.24-45.el6.noarch

4/27

Installing : 1:jakarta-commons-discovery-0.4-5.4.el6.noarch

5/27

Installing : tomcat6-el-2.1-api-6.0.24-45.el6.noarch
6/27

Installing : libgcj-4.4.6-4.el6.i686

7/27

Installing : java-1.5.0-gcj-1.5.0.0-29.1.el6.i686

8/27

Installing : 1:java_cup-0.10k-5.el6.i686

9/27

Installing : sinjdoc-0.5-9.1.el6.i686
10/27

Installing : jakarta-commons-pool-1.3-12.7.el6.i686

11/27

Installing : xml-commons-apis-1.3.04-3.6.el6.i686
12/27

Installing : log4j-1.2.14-6.4.el6.i686


13/27

Installing : classpathx-jaf-1.0-15.4.el6.i686
14/27

Installing : classpathx-mail-1.1.1-9.4.el6.noarch

15/27

Installing : jakarta-commons-dbcp-1.2.1-13.8.el6.noarch

16/27

Installing : wsdl4j-1.5.2-7.8.el6.noarch

17/27

Installing : xml-commons-resolver-1.1-4.18.el6.i686

18/27

Installing : 1:jakarta-commons-httpclient-3.1-0.6.el6.i686


19/27

Installing : axis-1.2.1-7.2.el6.noarch

20/27

Installing : 1:jakarta-commons-daemon-1.0.1-8.9.el6.i686

21/27

Installing : 1:ecj-3.4.2-6.el6.i686

22/27

Installing : regexp-1.5-4.4.el6.i686

23/27

Installing : bcel-5.2-7.2.el6.i686

24/27

Installing : 1:mx4j-3.0.1-9.13.el6.noarch

25/27

Installing : tomcat6-lib-6.0.24-45.el6.noarch

26/27

Installing : tomcat6-6.0.24-45.el6.noarch

27/27

Verifying: tomcat6-el-2.1-api-6.0.24-45.el6.noarch

1/27

Verifying: classpathx-mail-1.1.1-9.4.el6.noarch

2/27

Verifying: 1:jakarta-commons-httpclient-3.1-0.6.el6.i686

3/27

Verifying: 1:jakarta-commons-discovery-0.4-5.4.el6.noarch

4/27

Verifying: tomcat6-lib-6.0.24-45.el6.noarch

5/27

Verifying: jakarta-commons-pool-1.3-12.7.el6.i686

6/27

Verifying: jakarta-commons-collections-3.2.1-3.4.el6.noarch

7/27

Verifying: xml-commons-resolver-1.1-4.18.el6.i686

8/27

Verifying: tomcat6-servlet-2.5-api-6.0.24-45.el6.noarch

9/27

Verifying: tomcat6-6.0.24-45.el6.noarch

10/27

Verifying: 1:java_cup-0.10k-5.el6.i686

11/27

Verifying: sinjdoc-0.5-9.1.el6.i686

12/27

Verifying: libgcj-4.4.6-4.el6.i686

13/27

Verifying: jakarta-commons-logging-1.0.4-10.el6.noarch

14/27

Verifying: wsdl4j-1.5.2-7.8.el6.noarch

15/27

Verifying: axis-1.2.1-7.2.el6.noarch

16/27

Verifying: 1:jakarta-commons-daemon-1.0.1-8.9.el6.i686

17/27

Verifying: java-1.5.0-gcj-1.5.0.0-29.1.el6.i686
18/27

Verifying: bcel-5.2-7.2.el6.i686

19/27

Verifying: xml-commons-apis-1.3.04-3.6.el6.i686
20/27

Verifying: tomcat6-jsp-2.1-api-6.0.24-45.el6.noarch

21/27

Verifying: log4j-1.2.14-6.4.el6.i686

22/27

Verifying: 1:ecj-3.4.2-6.el6.i686

23/27

Verifying : 1:mx4j-3.0.1-9.13.el6.noarch

24/27

Verifying: jakarta-commons-dbcp-1.2.1-13.8.el6.noarch

25/27

Verifying: classpathx-jaf-1.0-15.4.el6.i686

26/27

Verifying: regexp-1.5-4.4.el6.i686

27/27

Installed:

tomcat6.noarch 0:6.0.24-45.el6

 

Dependency Installed:

axis.noarch 0:1.2.1-7.2.el6

bcel.i686 0:5.2-7.2.el6

classpathx-jaf.i686 0:1.0-15.4.el6classpathx-mail.noarch 0:1.1.1-9.4.el6

ecj.i686 1:3.4.2-6.el6jakarta-commons-collections.noarch

0:3.2.1-3.4.el6

jakarta-commons-daemon.i686
1:1.0.1-8.9.el6jakarta-commons-dbcp.noarch
0:1.2.1-13.8.el6

jakarta-commons-discovery.noarch 1:0.4-5.4.el6
jakarta-commons-httpclient.i686 1:3.1-0.6.el6

jakarta-commons-logging.noarch

0:1.0.4-10.el6
jakarta-commons-pool.i686 0:1.3-12.7.el6

java-1.5.0-gcj.i686
0:1.5.0.0-29.1.el6
java_cup.i686 1:0.10k-5.el6

libgcj.i686 0:4.4.6-4.el6log4j.i686
0:1.2.14-6.4.el6

mx4j.noarch 1:3.0.1-9.13.el6regexp.i686 0:1.5-4.4.el6

sinjdoc.i686 0:0.5-9.1.el6
tomcat6-el-2.1-api.noarch 0:6.0.24-45.el6

tomcat6-jsp-2.1-api.noarch

0:6.0.24-45.el6
tomcat6-lib.noarch 0:6.0.24-45.el6

tomcat6-servlet-2.5-api.noarch
0:6.0.24-45.el6
wsdl4j.noarch 0:1.5.2-7.8.el6

xml-commons-apis.i686

0:1.3.04-3.6.el6
xml-commons-resolver.i686 0:1.1-4.18.el6

Complete!

Get Tomcat related Information
after Successful Installation!!!

[root@localhost
~]#

 

[root@localhost ~]# yum info tomcat6

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

Installed Packages

Name: tomcat6

Arch: noarch

Version:6.0.24

Release: 45.el6

Size: 188 k

Repo:installed

From repo:base

Summary:Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API

URL: http://tomcat.apache.org/

License: ASL 2.0

Description : Tomcat is the servlet container that is used in the official Reference :
Implementation for the Java Servlet and JavaServer Pages technologies. :
The Java Servlet and JavaServer
Pages specifications are developed by :
Sun under the Java Community Process.:: Tomcat is developed in an open and participatory environment and : released under the Apache Software License version 2.0. Tomcat is intended : to be a collaboration of the best-of-breed developers from around the world.

[root@localhost ~]#

================================================================================

How to debug Web Application remotely with Eclipse Indigo and Tomcat 7.0.22?


Lets create and simple Web Application with Single Servlet.

Java – Download Free EBooks and Whitepapers

Visit How to Create and Run Web Project (Java) in Eclipse

Once the Web Application is ready, lets export .war file to Tomcat 7.0.22.

Visit How to Export WAR file from Eclipse to Tomcat

Now let’s verify whether debug property is set or not in catalina.bat file;

it is available at apache-tomcat-7.0.22bin; By default settings are done for debugging in Tomcat 7.0.22. If it is not done or modified then do the following changes.

catalina.bat in Tomcat
catalina.bat in Tomcat

Open the Servlet source file of the web application in Eclipse and set the BREAK point.

Breakpoint in Eclipse to debug web application remotely
Breakpoint in Eclipse to debug web application remotely

Select Debug Configurations

Now. Change the Debug Configurations.

Debug Configuration in Eclipse
Debug Configuration in Eclipse

Open command prompt -> Go to the path of Tomcat distribution Directory/bin

catalina jpda start

Start Tomcat in Debug Mode
Start Tomcat in Debug Mode

Click on Debug on Eclipse

Debug in Eclipse
Debug in Eclipse

Open the Browser and enter the URL (in our case it is http://localhost:8080/JavaWebProject/HelloWorldExample)

Run Web Application Firefox
Run Web Application Firefox

The moment you press enter, you will see debug mode indicator in taskbar,

Debug Mode
Debug Mode

Now the flow will be paused on the breakpoint we created earlier.

Remote debugging of an Application in Eclipse
Remote debugging of an Application in Eclipse

Now you can use Step Into (f5), Step Over (f6), Step Return (f7) to debug as per the application code and your requirement to debug, for simplicity we have only one statement for debugging.

Debug Buttons in Eclipse
Debug Buttons in Eclipse

Now in browser you will be able to see the output.

Servlet Output
Servlet Output

Other Interesting Tomcat related Articles:

How to Export WAR file from Eclipse to Tomcat


To export WAR file from the Dynamic Web Project in Eclipse, Follow below steps:

Export WAR File
Export WAR File

Java – Download Free EBooks and Whitepapers

Now select the destination where you want to deploy the WAR file; in our case, it will be Tomcat‘s “webapps” directory.

Select Destination to Deploy WAR file
Select Destination to Deploy WAR file

If you want to maintain source files (.java) then click on export source files as well.

Select Destination to Deploy WAR file
Select Destination to Deploy WAR file

Now verify the webapps directory in Tomcat’s distribution folder.

webapps directory in Tomcat's distribution folder
webapps directory in Tomcat’s distribution folder

Lets run the Web Application and verify

Run Tomcat, and you will notice that the WAR file content will be extracted into the folder

Once tomcat is Up and Running, Open Browser and open the URL http://localhost:8080/JavaWebProject/HelloWorldExample, you will see

Successful Servlet Execution in Tomcat Server in Browser
Successful Servlet Execution in Tomcat Server in Browser

Done!!! 🙂

Other Interesting Tomcat related Articles: