简体   繁体   English

ant build java程序找不到目标

[英]ant build java program could not find targets

I am maintaining a java program that is not mine. 我正在维护一个不是我的Java程序。 I used eclipse and I could build the program with Ant. 我使用了eclipse,可以用Ant构建程序。 I don't know very much about Ant. 我对蚂蚁不太了解。 Everything was installed fine on my eclipse IDE and the build worked perfect till today. 一切在我的Eclipse IDE上都安装得很好,并且该构建到目前为止一直运行良好。 I didn't change anything, so I don't know why it doesn't work anymore. 我没有做任何更改,所以我不知道为什么它不再起作用了。

When I look at the external Tools Configurations,I see that the targets are missing. 当我查看外部工具配置时,我发现目标丢失了。 I have the message "No targets could be determined for the build file". 我收到消息“无法为构建文件确定目标”。 Previously I could select some targets. 以前,我可以选择一些目标。 Does someone know how it come that the targets disappeared? 有人知道目标消失的原因吗?

I fixed it by switching the eclipse workspace. 我通过切换Eclipse工作区来修复它。 I went to menu File->Switch Workspace->Other, and then I have selected the same workspace I was working with. 我转到菜单文件->切换工作区->其他,然后选择了我正在使用的相同工作区。 Eclipse restarted and the error wasn't there anymore. Eclipse重新启动,错误不再存在。

这对我有所帮助:从Ant视图中删除构建文件,然后再次添加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行 Ant Build.xml 得到:Java 虚拟机启动器:找不到主 ZA2F2ED4F8EBC2ABCBBDC2。 程序将会退出 - Running Ant Build.xml getting: Java Virtual Machine Launcher: Could not find the main class. Program will exit Ant构建文件和目标 - Ant build files and targets 使用Ant运行java程序时无法找到或加载主类? - Could not find or load main class when Running java program using Ant? Java-Ant构建(Eclipse)-找不到主类:nat.rutherford.DesktopStarter - Java - Ant build (Eclipse) - Could not find the main class: nat.rutherford.DesktopStarter Apache Ant:无法找到主类。 程序将会退出 - Apache Ant: Could not find the main class. Program will exit “全部”构建无法继续。 '无法运行程序“ java”。 - “ant all” build unable to continue. 'Cannot run program “java”.' 在Java程序中使用Apache Ant API以编程方式构建源文件 - Using Apache Ant APIs in Java program to programmatically build source files 如果它引用的java程序抛出异常,则ANT构建文件失败 - failing An ANT build file if the java program it's referring to throws an Exception 无法在Java ant中找到或加载主类NotifyAdministrator - Could not find or load main class NotifyAdministrator in java ant 运行时错误:在 java 程序中找不到 main - Runtime error : could not find main in java program
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM