JSP Development Environment built

Source: Internet
Author: User
Tags exit tomcat apache tomcat java se

The JSP development environment is where you use to develop, test, and run JSP programs.

This section will take you to build a JSP development environment, including the following steps.

Configuring the Java Development tool (JDK)

This step involves downloading the Java SDK and configuring the PATH environment variable.

You can download Sdk:java SE Downloads from Oracle Company's Java pages

After downloading the Java SDK, follow the instructions given to install and configure the SDK. Finally, you set the path and JAVA_HOME environment variables to indicate the folder paths that include Java and javac, usually Java_install_dir/bin and Java_install_dir.

If you are using a Windows system and the SDK installation directory is c::jdk1.5.0_20, you will need to add the following two lines to the C:autoexec.bat file:

Set path=c:jdk1.5.0_20bin;%path%

Set java_home=c:jdk1.5.0_20

Alternatively, under Windows Nt/2000/xp, you can right-click on my Computer icon, select Properties, then advanced, then environment variables, and then you can easily set the path variable and make sure to exit on the line.

Under the Linux/unix system, if the SDK installation directory is/usr/local/jdk1.5.0_20 and the C shell is used, then you need to add the following two lines to the. cshrc file:

Setenv Path/usr/local/jdk1.5.0_20/bin: $PATH

Setenv java_home/usr/local/jdk1.5.0_20

Or, if you're using an integrated development environment like Borland JBuilder, Eclipse, IntelliJ idea, and Sun one studio, try compiling and running a simple program to determine whether the IDE (the integrated development environment) already knows The installation directory for the SDK.

This step you can also refer to the Site Java Development Environment Configuration Chapter Tutorial.

Setting up a Web server: Tomcat

Currently, there are many Web servers in the market that support JSP and Servlets development. Some of them can be downloaded and used for free, and Tomcat is one of them.

Apache Tomcat is an open-source software that can be used as a stand-alone server to run JSP and Servlets, or it can be integrated in the Apache WEB server. The following is the configuration method for Tomcat:

Download the latest version of tomcat:http://tomcat.apache.org/.

After downloading the installation files, unzip the compressed file to a convenient location, such as the c:apache-tomcat-5.5.29 directory under Windows or Linux/unix/usr/local/ apache-tomcat-5.5.29 directory, and then create Catalina_home environment variables to point to these directories.

Under the Windows machine, Tomcat can start by executing the following command:

%catalina_home%binstartup.bat

Or

C:apache-tomcat-5.5.29binstartup.bat

Under the Linux/unix machine, Tomcat can start by executing the following command:

$CATALINA _home/bin/startup.sh

Or

/usr/local/apache-tomcat-5.5.29/bin/startup.sh

After successfully booting Tomcat, you can use some of the web apps that Tomcat brings with you by accessing http://localhost:8080/. If all goes well, you should be able to see the following pages:

More information about configuring and running Tomcat can be found in the documentation provided by Tomcat or on the Tomcat website: http://tomcat.apache.org.

Under the Windows machine, tomcat can stop by executing the following command:

%catalina_home%binshutdown

Or

C:apache-tomcat-5.5.29binshutdown

Under the Linux/unix machine, Tomcat can stop by executing the following command:

$CATALINA _home/bin/shutdown.sh

Or

/usr/local/apache-tomcat-5.5.29/bin/shutdown.sh

Setting CLASSPATH Environment variables

Since Servlets is not part of the Java SE, you must mark the compiler for the servlet class.

If you are using a Windows machine, you need to add the following two lines to the C:autoexec.bat file:

Set catalina=c:apache-tomcat-5.5.29

Set classpath=%catalina%commonlibjsp-api.jar;%classpath%

Or, under Windows NT/2000/XP, you just right-click My Computer, select Properties, click Advanced, then click on the environment variable, and then you can set the CLASSPATH variable and make sure to exit.

Under the Linux/unix machine, if you are using the C shell, you need to add the following two lines to the. cshrc file:

Setenv catalina=/usr/local/apache-tomcat-5.5.29

Setenv CLASSPATH $CATALINA/common/lib/jsp-api.jar: $CLASSPATH

Note: If your development path is C:jspdev (Windows) or/usr/jspdev (Linux/unix), then you need to add these paths to the CLASSPATH variable.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.