Java configuration and tomcat error resolution

Source: Internet
Author: User

Problem: the following problem occurs when you configure the Tomcat runtime environment today,

The catalina_home environment variable is not defined correctly
This environment variable is needed to run this program

Then the catalina_home environment variable is added, and a new problem occurs.

The java_home environment variable is not defined correctly
This environment variable is needed to run this program
NB: java_home shocould point to a JDK not a JRE

The java_home path must be correct.

Solution: Change java_home to jre_home.

Solution: The java_home setting is incorrect. JDK is the installation path. JRE is the one in JDK.

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

Configure the manager username and password in Tomcat

Add in CONF/tomcat-users.xml:
<Role rolename = "manager"/>
<Role rolename = "admin"/>
<User Username = "admin" Password = "123456" roles = "Admin, Manager"/>

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

Easy to use, Java environment variable settings:

1. Install JDK. You can customize the installation directory and other information during the installation process. For example, select D: \ Java \ jdk1.5.0 _ 08 as the installation directory;

2. After the installation is complete, right-click "my computer" and click "properties ";

3. Select the "advanced" tab and click "environment variables ";

4. In "system variables", set three attributes: java_home, path, and classpath (case-insensitive). if it already exists, click "edit". If it does not exist, click "new ";

5. java_home indicates the JDK installation path, which is the path D: \ Java \ jdk1.5.0 _ 08 selected during the installation. This path contains Lib, bin, JRE, and other folders (it is best to set this variable, because in the future, tomcat, eclipse, and so on all need to follow * this variable );

Path allows the system to recognize Java commands in any path. It is set:

% Java_home % \ bin; % java_home % \ JRE \ bin

Classpath is the class or lib path of the Java load class. Only the class in classpath can be identified by the Java command and set:

.; % Java_home % \ Lib \ DT. jar; % java_home % \ Lib \ tools. Jar (Add. to indicate the current path)

% Java_home % refers to the previously specified java_home;

6. "Start"->; "run", type "cmd ";

7. type the following commands: "Java-version", "Java", and "javac". If a screen is displayed, the environment variable is successfully configured;

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.