Perhaps JAVA_HOME does not point to the JDK
Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK异常
Monday, 19. June 2006, 05:42:14
Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK
tomcat_home, java_home都已经添加到了环境变量里,但今天启动jsp的时候却出现了以下的异常
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
第一种解决方案:
后来上网找到了解决方案:只要把JAVA_HOME/lib/tools.jar拷到TOMCAT_HOME\common\lib下,重启动Tomcat,就可以了,这个问题郁闷了好久,终于解决了,一定要记下来
第二种解决方案:
原因是在装Tomcat的时候没设置JAVA_HOME,
Tomcat搜索Jvm只找到了c盘的jvm,因此Unable to find a javac compiler
(其实这时你选择正确的jdk安装目录就没问题了)
修改方法是在tomcat控制台(就是双击tomcate5w.exe)java选项-〉java virtual machine
设置为d:\webserv\jdk1.4\jre\bin\server\jvm.dll
tomcat控制台java选项-〉Java classpath:
D:\webserv\Tomcat 5.0\bin\bootstrap.jar;d:\webserv\jdk1.4\lib\tools.jar
把对应的目录改成你的就行了