外部jar无法在MANIFEST.MF中解析为捆绑包 [英] External jars not resolved as bundles in MANIFEST.MF

查看:95
本文介绍了外部jar无法在MANIFEST.MF中解析为捆绑包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新的问题:

我不得不从某些已知的来源中导入一个项目.该项目抱怨缺少进口.因此,我从互联网上下载了.jar并将其添加为外部jar.

I had to import a project from some sources that I had been given. The project complained of missing imports. Therefore, I downloaded the .jar from internet and added them as external jar.

在我的Eclipse Indigo Java EE中,我通过遵循

In my Eclipse Indigo Java EE, I added missing .jar file to Java Project by following How to import a jar in Eclipse

添加jar之后,类中import语句中的错误消失了.但是,MANIFEST.MF引发未解决的捆绑错误.源文件中存在的MANIFEST.MF文件有一个"Require-Bundle",在这些文件下列出了这些文件(也许已经被它们捆绑了,但是没有给出捆绑文件),我得到的错误是:

The errors in the import statements in the classes disappeared after adding the jar. However, the MANIFEST.MF throws a bundle not resolved error. The MANIFEST.MF file which had existed in the sources had a "Require-Bundle" under which these were listed(perhaps bundled already by them but the bundles weren't given) where the error I get is:

例如:org.apache.commons.configuration; bundle-version ="1.7.0"

eg: org.apache.commons.configuration;bundle-version="1.7.0"

捆绑的"org.apache.commons.configuration"无法解析

Bundle 'org.apache.commons.configuration' cannot be resolved

如何解决这个问题?

预先感谢

推荐答案

您需要检查该捆绑包是否为OSGi捆绑包.展开并查看其MANIFEST.MF.您应该能够从获得要导入的项目的同一位置获得该捆绑软件的OSGi版本.然后将该捆绑包添加到您的目标平台.请参见 Preferences>插件开发>目标平台.您可以编辑活动平台或通过全新安装的Eclipse创建一个新平台.

You need to check that the bundle is an OSGi bundle. Expand and look at its MANIFEST.MF. You should be able to get the OSGi version of that bundle from the same place you got the project you are trying to import. Then add that bundle to your Target Platform. See Preferences>Plug-in Development>Target Platform You can edit your active platform or create a new one from a fresh install of eclipse.

这篇关于外部jar无法在MANIFEST.MF中解析为捆绑包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆