May 15, 2021 Struts2
1. Step 1 - Install the Java Development Kit (JDK):
2. Step 2 - Install Apache Tomcat:
Our first task was to run a minimal Struts2 application. T
his chapter will show you how to build a Struts2 development environment.
Let's say your PC already has JDK (5 plus), Tomcat, and Eclipse installed, and if you don't have these components installed, follow the shortcuts listed below:
You can download the latest version of SDK: Java SE download link on the Java page of Oracle's website. I n the download file you can see the instructions for installing the JDK and follow the instructions for installing and configuring the settings. Finally, set the path and JAVA_HOME environment variables to the referenced directory that contains Java and Java, typically java_install_dir/bin and java_install_dir.
If you're installing the SDK to C: jdk1.5.0_20 windows system, you'll need to put the following code in your C: .bat C: .
set PATH=C:\jdk1.5.0_20in;%PATH% set JAVA_HOME=C:\jdk1.5.0_20In addition, in Windows NT/2000/XP, you can right-click On My Computer, select Properties → Advanced → Environment Variables, and then update the path value and press the OK button.
In Unix (or Solaris, Linux, etc.), if the SDK is installed on disk C /usr/local/jdk1.5.0_20, you can put the following code into the .cshrc file.
setenv PATH /usr/local/jdk1.5.0_20/bin:$PATH setenv JAVA_HOME /usr/local/jdk1.5.0_20
Also, if you're using an integrated development environment (IDE) like Borland JBuilder, Eclipse, IntelliJ IDEA, or Sun ONE Studio, compile and run a simple program to confirm that the IDE has found the location of the Java you installed, otherwise you'll set it up correctly according to the documentation given by the IDE.
%CATALINA_HOME%in\startup.bat or C:\apache-tomcat-6.0.33in\startup.batIn a Unix (or Solaris, Linux, etc.) environment, Tomcat can be started by executing the following instructions:
$CATALINA_HOME/bin/startup.sh or /usr/local/apache-tomcat-6.0.33/bin/startup.shAfter successful startup, the default web program that contains Tomcat can be accessed http://localhost:8080/ the user. If all goes well, the following results are displayed:
%CATALINA_HOME%in\shutdown or C:\apache-tomcat-5.5.29in\shutdownIn a Unix (or Solaris, Linux, etc.) environment, Tomcat can be stopped by executing the following instructions:
$CATALINA_HOME/bin/shutdown.sh or /usr/local/apache-tomcat-5.5.29/bin/shutdown.sh
%C:\eclipse\eclipse.exeIn a Unix (or Solaris, Linux, etc.) environment, Eclipse can be started by executing the following instructions:
$/usr/local/eclipse/eclipseIf all goes well after a successful startup, the following results are displayed: