How do I quot;installquot; a log4j bundle?(我如何“安装?一个 log4j 包?)
问题描述
我已经下载了 Eclipse 插件的代码.该代码使用 log4j,但它不仅将其用作库(称为 jar),还用作捆绑包".所以它没有编译,原因如下:
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:
无法解析捆绑org.apache.log4j"
Bundle 'org.apache.log4j' cannot be resolved
我不确定解决此问题的正确方法是什么.我知道如何将 jars 添加到项目中,但是如何添加捆绑包"?我需要将它添加到整个 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 包"的地方,例如:
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 开发中的类路径".您可以找到目标平台的位置,并通过Preferences -> Plug-in Development -> Target Platform 进行修改.
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.
但是在此之前,我强烈建议您花一些时间了解一下您正在从事的工作!如果您想开发一个 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 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我如何“安装"?一个 log4j 包?
基础教程推荐
- Java:带有char数组的println给出乱码 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01