如何“安装”一个log4j包? [英] How do I "install" a log4j bundle?

查看:170
本文介绍了如何“安装”一个log4j包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了Eclipse插件的代码。代码使用log4j,但它不仅将其用作库(引用jar),而且将其用作bundle。所以没有编译,原因如下:

I've downloaded the code for an Eclipse plugin. The code uses log4j, but it doesn't just use it as a library (referred jar), but as a "bundle". So it doesn't compile because of the following reason:


Bundle'org.apache.log4j'无法解析

Bundle 'org.apache.log4j' cannot be resolved

我不太确定什么是正确的方法来解决这个问题。我知道如何添加罐子到一个项目,但如何添加捆绑?是否需要添加到整个Eclipse主机?

I'm not really sure what's the correct approach to solve this. I know how to add jars to a project, but how do I add "bundles"? Is it something I need to add to the entire Eclipse host?

我通过创建一个没有代码的新的插件项目来解决这个问题,但是包含了log4j jar。但是这并不是正确的解决方案。

I "solved" this by creating a new plugin project with no code but with the log4j jar included... but that doesn't feel like the right solution.

我还发现了一些出现log4j bundle的地方,例如:

I've also found some places where "log4j bundles" are published, e.g.:

  • http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.org.apache.log4j&version=1.2.16
  • http://download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/

但我是不确定这是我需要的,如果它是重要的,我得到它,以及如何安装它。

But I'm not sure if that's what I need, if it matters where I get it from, and how to "install" it.

推荐答案

我假设您正在使用Eclipse插件开发环境(PDE)。在这种情况下,log4j包需要导入到目标平台中。

I assume you are using the Eclipse Plugin Development Environment (PDE). In this case, the log4j bundle needs to be imported into the "Target Platform".

目标平台就像一个捆绑(即插件)替代的存储库传统Java开发中的classpath。您可以找到目标平台的位置,并通过转到首选项 - >插件开发 - >目标平台进行修改。

The Target Platform is like a repository of bundles (i.e. plug-ins) that replaces the "classpath" in traditional Java development. You can find the location of the target platform and modify it by going to Preferences -> Plug-in Development -> Target Platform.

HOWEVER 在此之前,我强烈建议您花点时间来了解一下您正在做的工作!如果您想开发Eclipse插件,您应该至少了解一个插件是什么,以及它的依赖关系如何工作。如果您阅读有关该主题的内容,您不必在Stack Overflow上提出这样一个非常基本的问题,请参见所有介绍性教程和常见问题解答。

HOWEVER before doing this I strongly recommend you take some time to learn a bit about what you are working on! If you want to develop an Eclipse Plug-in you should at least learn what a plug-in is, and how its dependencies work. If you read a bit about the subject you should not have to ask such an extremely basic question on Stack Overflow... it is covered in all the introductory tutorials and FAQs.

这篇关于如何“安装”一个log4j包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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