简体   繁体   English

Eclipse Mars:ANT任务引用缺少的SWT库

[英]Eclipse Mars: ANT Task references missing SWT library

I just upgraded to Eclipse Mars and suddenly my ANT task working fine with Lunar complains: 我刚刚升级到Eclipse Mars,突然我的ANT任务与Lunar抱怨很好:

The archive: C:/Program%20Files/eclipse_lunar/plugins/org.eclipse.swt.win32.win32.x86_64_3.104.0.v20150528-0211.jar which is referenced by the classpath, does not exist.

Which is weird, because 这很奇怪,因为

  • I'm sure none .classpath file does reference to this jar 我确定没有.classpath文件引用这个jar
  • the jar actually exists under that path jar实际上存在于该路径下

After some research it seems it is related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=470390 经过一些研究后,它似乎与https://bugs.eclipse.org/bugs/show_bug.cgi?id=470390有关

Anyone has a solution to run my ANT (besides from using lunar again) ? 任何人都有解决方案来运行我的ANT(除了再次使用月球)?

这对我有用:

mklink /D D:\Program%20Files "D:\Program Files"

Move the eclipse program directory to another folder wihtout spaces 将eclipse程序目录移动到另一个没有空格的文件夹中

  • for example simply to c:\\eclipse 例如,简单到c:\\eclipse

Problem: 问题:

Error message: 错误信息:

The archive: C:/Program%20Files%20(x86)/Eclipse%20Mars/plugins/org.eclipse.swt.win32.win32.x86_64_3.104.0.v20150528-0211.jar which is referenced by the classpath, does not exist. 归档:C:/ Program%20Files%20(x86)/Eclipse%20Mars/plugins/org.eclipse.swt.win32.win32.x86_64_3.104.0.v20150528-0211.jar由类路径引用,不存在。

The problem was the Eclipse Mars is downloaded and extracted under a folder which space contained in its name. 问题是Eclipse Mars被下载并提取到其名称中包含的文件夹下。 In the above error message the path contains folder names with spaces in between and displayed as %20 . 在上面的错误消息中,路径包含文件夹名称,其间有空格并显示为%20

Solution: 解:

Inorder to solve this use anyone of the workaround mentioned below, 为了解决这个问题,请使用下面提到的任何解决方法,

  • Remove any spaces in any of the directory where you have stored Eclipse. 删除存储Eclipse的任何目录中的所有空格。
    eg: Rename My Folder to MyFolder 例如:将My Folder重命名为MyFolder
  • Move you eclipse to the root of any drive(C: or D: or F: etc) 移动你的日食到任何驱动器的根(C:或D:或F:等)
    eg: D:\\eclipse-jee-mars-R-win32-x86_64 例如: D:\\eclipse-jee-mars-R-win32-x86_64
  • Create a symbolic link folder in windows using mklink command, 使用mklink命令在Windows中创建符号链接文件夹,

    mklink /d D:\\My%20Folder "D:\\My Folder"

You'll get the following message, 您将收到以下消息:

symbolic link created for D:\\My%20Folder <<===>> D:\\My Folder

Note: For creating symbolic link you need to run the above command in the elevated command prompt. 注意:要创建符号链接,您需要在提升的命令提示符下运行上述命令。

Now you can run the ant scripts without the above error. 现在您可以运行ant脚本而不会出现上述错误。 This is a bug reported to eclipse and will be patched in the future releases. 这是一个向eclipse报告的错误,将在未来版本中修补。

一个可能的解决方案是创建文件夹“C:\\ Program%20Files \\ eclipse_lunar \\ plugins”并从“C:\\ Program Files \\ eclipse_lunar \\ plugins”中放置实际* .jar的副本

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM