这种情况通常是发生在换了另一份 Eclipse 拷贝之后。之前一般都能正常在 Eclipse 中执行 Ant 脚本,删除了原来的 Eclipse 之后换了另一个拷贝或者是新版本,在其中执行 Ant 脚本时弹出窗口出现以下错误:
---------------------------
Java Virtual Machine Launcher
---------------------------
Could not find the main class. Program will exit.
---------------------------
确定
---------------------------
这种错误对用过 Java 的人来说还是很明白,找不到 Ant 的主类吗。不过说实话也困扰过我一段时间,也没去深究。说开了,症结就是 Eclipse 中的 ANT_HOME 指向不对。
解决办法:Eclipse 中进入 Window->Preferences->Ant->Runtime,在Classpath 标签页,看到 Ant Home Entries 指向的目录不对了(它仍然指向你上回的目录,而这个目录应该不存在了),你要做的就是改变 Ant Home 指向正确的目录,点 Ant Home 按钮,选择 Ant Home 目录,比如我用的 Eclipse 是 3.3.1 的,Ant Home 是 Eclipse 的插件目录下的 org.apache.ant_1.7.0.v200706080842。
现在可以再次在 Eclipse 中执行你的 Ant 脚本,是不是能正常运行了啊!
文章转自:http://apps.hi.baidu.com/share/detail/6404473
分享到:
相关推荐
Eclipse 编译时遇到错误could not find the main class,program will exit的解决方法
Eclipse中使用Ant
eclipse下利用ant、junit进行自动化测试例子源码
eclipse中如何使用ANT,eclipse中如何使用ANT,eclipse中如何使用ANT,eclipse中如何使用ANT,eclipse中如何使用ANT
org.eclipse.emf.ant_2.1.0.jarorg.eclipse.emf.ant_2.1.0.jarorg.eclipse.emf.ant_2.1.0.jarorg.eclipse.emf.ant_2.1.0.jar
Using ANT in Eclipse
Eclipse之ANT使用,开发部署工具利器!
在eclipse中使用ant灵活构建web应用.docx
requires 'org.eclipse.emf 2.6.0' but it could not be found),解决方法:将“离线解决方案”文件夹中的org.eclipse.emf 2.6.0的jar,拷贝到自己的eclipse的plugin文件夹下面,重启eclipse再次安装activiti插件就...
使用 Eclipse 和 Ant 进行 Python 开发
一个关于ant4eclipse的插件的东东
在Eclipse中反编译Class文件完全详解在Eclipse中反编译Class文件完全详解在Eclipse中反编译Class文件完全详解
eclipse中git插件eclipse中git插件eclipse中git插件eclipse中git插件eclipse中git插件
NULL 博文链接:https://chen106106.iteye.com/blog/1500730
eclipse ant打包,所需要的内容ant 文件夹,里面的内容请根据自己的目录,秘钥进行修改 然后放进工程根目录即可
ant打包rcp必备环境 eclipse-3.8.2-delta-pack eclipse-SDK-3.8.2-win32 org.eclipse.rcp-3.8.2
具体报错如下: Cannot complete the install because one or more required items could not be found. Software being installed: Activiti Eclipse BPMN 2.0 Designer 5.18.0.201508100929 (org.activiti....