JAVA开发环境搭建

开发环境Eclipse Juno  (中文版,支持在线安装)

运行环境Apache 2.2, Tomcat 7

常见问题

Q:在Eclipse中直接启动Tomcat运行项目,提示ClassNotFoundException: XXX Class错误。

A:手动将项目引用的所有外部Jar包复制到项目的webContent/WEB-INF/lib文件夹下。并重新启动Tomcat。

Q:java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplication

A:系统环境变量加上JAVA_HOME=<JDK_INSTALL_PATH> (你的JDK安装路径),自定义环境变量的PATH里加上PATH=%JAVA_HOME%\bin

Q:java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

A

Q:Java EE Module Dependencies is replaced by Web Deployment Assembly

A:In Eclipse Galileo (3.5) or Ganymede (3.4) or older version, you can control the project packaging structure via the “Java EE Module Dependencies ” option, so that the project dependencies are deployed to the correct folder.

     However, in the latest Eclipse Helios (3.6) , the “Java EE Module Dependencies ” is replaced by “Web Deployment Assembly “, which provide more powerful and flexible ways to configure the project packaging structure.

Q:Tomcat无法启动,报错java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory

A:Solutions

1. In Eclipse, Open the windows - > preference -> Server   tab.(或是在eclipse下方的server选项卡里,双击新建的"服务器",点击打开窗口中的"Open launch configuration"链接)
2. Double click on the “Tomcat6″ entry to see the configuration.
3. Then click on the “Open launch configuration” link in the “General information” block.
4. In the dialog, select the “Classpath” tab.
5. Click the “Add external jar” button.
6. Select the file Tomcat安装目录下的“bin/tomcat-juli.jar”
7. Close the dialog.
8. Start tomcat 6 from Eclipse.

实际上,就是在tomcat配置页里的classpath选项下引用bin/tomcat-juli.jar文件即可。

Q:Unable to compile class for JSP

A:系统环境变量,JAVA_HOME没有设置正确。

你可能感兴趣的:(java开发)