您的位置:首页 > 编程语言 > Java开发

找不到com.sun.tools.javac.Main的解决办法

2008-05-15 10:02 197 查看
java.lang.ClassNotFoundException: com.sun.tools.javac.Main
使用resin在eclipse里调试时终于解决了这个问题了!原因其实很简单:

右键:properties-->librares-->选中jre edit-->选中alternate jre

明白了吧:原来这里配的是jre

点installed jres...

然后把tools.jar那几个包加上就ok了!

今天,在eclipse2.1中用run ant运行ppig写的ant脚本编译学习日记文档时,发现通不过,报找不到com.sun.tools.javac.main;但不在eclipse2.1环境中在dos命令行窗口中执行能通过。最后,在windows->preferences->ant->Runtime->Classpath->Add Jars中,添加了jdk下面的/lib/tools.jar后,编译通过。原来com.sun.tools.javac.Main在这个tools.jar中。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  eclipse ant dos jdk 脚本 文档