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

来源:互联网 发布:酒鬼蔷薇圣斗事件 知乎 编辑:程序博客网 时间:2024/05/20 21:58

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中。

原创粉丝点击