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
解決方案網址:http://blog.csdn.net/Think2Exist/archive/2004/10/08/128411.aspx
經過探索發現問題出在Eclipse 3啓動Tomcat時的Classpath上,tools.jar在Tomcat啓動時需要,但現在找不到(事實上系統變量Classpath已經指明瞭 tools.jar所在),系統是去JRE的lib下找,可是這個包默認應該在[JDK]的lib下(注:用的是JDK build 1.4.2_03-b02),問題的解決很簡單,只要複製[JDK].jar到[JRE]下即可。
解決方案有二:
1.找到jdk的lib目錄下的tools.jar,拷貝到tomcat的common目錄下即可
2. 打開eclipse,在菜單windows->preferences->tomcat->jvm settings,在classpath欄下添加tools.jar即可。