Build常见错误

时间:2025-02-07 21:35:14

1、ant 解决com.sun.tools.javac.Main is not on the classpath的问题

在ant打包时报错:

解决com.sun.tools.javac.Main is not on the classpath的问题

com.sun.tools.javac.Main is not on the classpath.
  Perhaps JAVA_HOME does not point to the JDK.
  It is currently set to "C:\Program Files\Java\jre6"

遇到这种情况时直接将C:\Program Files\Java\jdk1.6.0_17\lib中的tools.lib拷贝到C:\Program Files\Java\jre6\lib中即可。

2、eclipse add and remove中找不到工程

原因是workspace中的工程目录下缺少了.setting文件!可以创建一个demo的web项目后,将.setting目录下的文件拷贝到目标项目的对应目录下。

3、Server at localhost was unable to start within 45 seconds解决办法

在网上查了好多资料,大部分童鞋在遇到此问题时的做法是去更改Tomcat的start-timeout配置参数,把超时时间改的长一些。我的eclipse是galileo版本。具体做法是: 
      双击servers的选项卡里的Tomcat服务器(注意是双击哦),打开Tomcat的配置视图 --> 在页面右半部分有个Timeouts配置项,点开,更改‘start(in seconds)’参数值为100或更大 --> 然后保存配置。