Eclipse中执行Ant出现Could not find the main class的问题及解

这种情况通常是发生在换了另一份 Eclipse 拷贝之后。之前一般都能正常在 Eclipse 中执行 Ant 脚本,删除了原来的 Eclipse 之后换了另一个拷贝或者是新版本,在其中执行 Ant 脚本时弹出窗口出现以下错误:

---------------------------
Java Virtual Machine Launcher
---------------------------
Could not find the main class. Program will exit.
---------------------------
确定  
---------------------------

这种错误对用过 Java 的人来说还是很明白,找不到 Ant 的主类吗。不过说实话也困扰过我一段时间,也没去深究。说开了,症结就是 Eclipse 中的 ANT_HOME 指向不对。 阅读全文 >>