Java environment configuration Note 1

Source: Internet
Author: User
Tags jboss

1. Concepts of nouns:

JDK: Java javaslop kit-Java Development Kit (the most basic Java Development Kit)

J2sdk: JDK is called JDK before version 1.4. It can be understood that j2sdk is an upgraded version of JDK, so we only need to install j2sdk, and JDK is unnecessary.

Several j2sdk versions correspond to several versions of Java2. The development tool j2eesdk is required for J2EE, but most application servers (WebLogic
JBoss, etc.) are built with j2eesdk. Therefore, the next JBoss contains the corresponding J2EE development kit.
J2se:
J2sdk is the standard version. Generally, j2sdk refers to j2se.
J2EE: Also known as j2eesdk, used for enterprise-level development.
JRE: Java
Runtime envionment --
Java Runtime Environment, which is included in JDK, but for users who do not need to develop but run, they can only install JRE separately, so sun provides the download of JRE.

 

2. installation steps:
1. After j2sdk is installed, go to my computer> Properties> advanced> environment variables> system variables.
 
Add the following environment variables
Java_home = C:/j2sdk1.4.2;
The directory you installed
Classpath =.; % java_home %/lib/dt. jar; % java_home %/lib/tools. jar;
(.; Cannot be less, indicating the current path)

Path = % java_home %/bin;
Add

Then write a Java program to test whether j2sdk has been installed successfully:
Public class myjava {

Public static void main (string ARGs []) {

 
System. Out. println ("Hello
World? ");
}
}

Save the above program as a file named myjava. java.

Open the Command Prompt window, and then type the following command. Note that the myjava file name
It must be case-insensitive to the class name.
Javac myjava. Java
Java
Myjava

3. After Tomcat is installed, add it to environment variables (my computer> Properties> advanced> environment variables> system variables ).
Below
* Catalina_home = C:/tomcat; (tomcat security directory)
* Catalina_base = C:/tomcat;
* Modify the classpath and append the servlet. Jar under common/lib under the Tomat installation directory to the classpath (not overwrite), as follows:

Classpath =.; % java_home %/lib/dt. jar; % java_home %/lib/tools. jar;

% Catalina_home %/common/lib/servlet. jar;

Start Tomcat and access http: // localhost: 8080 in IE in the bin directory. If you see the welcome page of Tomcat, the installation is successful.

4. Create your own JSP page in Tomcat
 
Create a directory under the webapps directory of the tomcat installation directory, for example, MyApp;
 
Create a directory WEB-INF under MyApp (directory names are case sensitive );
Create a web. xml file in the directory with the following content:


BR> Public "-// Sun Microsystems, Inc. // DTD web application 2.3 // en"
Http://java.sun.com/dtd/web-app_2_3.dtd>


My web
Application

A Application
Test.


At the same time, create a test JSP page under the directory named index. jsp. The file content is as follows:

Restart Tomcat and enter http: // localhost: 8080/mytest/index. jsp in IE.

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.