Unable to find a javac compiler; com. Sun. Tools. javac. Main is not on the classpath. Perhaps java_home

Source: Internet
Author: User
Unable to find a javac compiler; com. Sun. Tools. javac. Main is not on the classpath. Perhaps java_home does not point to the JDK ()

Solution:Java_home (Java installation directory)/lib/tools. JarCopy to tomcat_home (tomcat installation directory)/common/lib and restart tomcat.

Causes and solutions:

When Tomcat is installed, the JRE path is specified. As a result, atat_home and java_home have been added to environment variables, but the following exception occurs when JSP is started:
Unable to find a javac compiler;
Com. Sun. Tools. javac. Main is not on the classpath.
Perhaps java_home does not point to the JDK

The cause is that Java. home refers to $ java_home/JRE, and the tools under its Lib. jar and $ java_home/lib/tools. jar is different. The latter must be used for JSP compilation.

Note: Java. Home points to $ jre_home during running.
JDK 1.4.2 _ 06-b03
JDK 1.5.0 _ 05-b05
This is the case.

Modification Method: In the atat (((((( ate5w.exe) Java option-> Java Virtual Machine
Set to % java_home %/JRE/bin/Server/JVM. dll
Tomcat console Java option-> JAVA classpath:
% Tomcat_home %/bin/Bootstrap. jar; % java_home %/lib/tools. Jar
Note: % java_home % and % atat_home indicate the installation root directories of JDK and tomcat respectively.

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.