学习Struts-郁闷的第一步,环境问题

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

今天有点心血来潮,突然想自己整个struts的应用学习一下,于是拿来前阵子买的《精通struts:基于MVC的Java Web设计与开发》,看到第二章,有个非常简单的例子,因此觉得拿来上手。

启动tomcat5.0.19,在地址栏输入http://localhost:8080/helloapp/,

......居然显示了一页编译错误,很是郁闷。

错误信息如下:

org.apache.jasper.JasperException:Unable to compile class for JSP

No Java compiler was found to compile

the generated source for the JSP.

This can usually be solved by copying manually

$JAVA_HOME/lib/tools.jar from the JDK

to the common/lib directory of the Tomcat server,

followed by a Tomcat restart.

If using an alternate Java compiler,

please check its installation and access path...

开始查找原因,设置了环境变量后,重新启动了tomcat,结果错误依旧,痛苦万分~

上google,果然好用,一下就找到了解决方法:

1. Make sure the following environment variables are set correctly:

>>> JAVA_HOME points to "C:\j2sdk1.4.2" (correct folder if changed)

>>> CLASSPATH points to %JAVA_HOME%\lib

>>> PATH points to %JAVA_HOME%\bin

2. copy $JAVA_HOME/lib/tools.jar to the common/lib directory of the Tomcat server

3. Update your registry to reflect the new JVM location:

key: HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Apache

Tomcat/Parameters/JVM Library

value: C:\j2sdk1.4.2\jre\bin\server\jvm.dll

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航