arka

BlogJava 首页 新随笔 联系 聚合 管理
  5 Posts :: 1 Stories :: 1 Comments :: 0 Trackbacks

想在自己的插件中导入一个dom4j.jar包,否则通过不了编译,除了wrapped  library plugin方式,难道没其他的办法了吗 ,在书上找了一段:

A JAR can be added to the classpath of a plug-in in four ways.

  1. The JAR can be added to the boot classpath. This is generally a bad idea, however, as it requires an extra VM argument, and it also affects the classpath of all other installed plug-ins. If the JAR adds types—classes or interfaces—that mask types declared in other plug-ins, you will probably break those other plug-ins. Nonetheless, if you are looking for a quick and dirty hack, this is the easiest approach.

     

  2. The JAR can be added to the declared libraries for a plug-in. This is fine if you don’t anticipate a need for other plug-ins also to use that JAR.

     

  3. A new plug-in can be created that is a wrapper for the library; then the new plug-in is added to the list of required plug-ins for all plug-ins that want access to the library.

     

  4. The OSGi parent loader can be changed by setting the osgi.parentClassloader system property on startup. This is also generally a bad idea, for the same reasons listed for changing the boot classpath.

     

好像第二种满足要求,但哪位知道怎么设置?

posted on 2006-01-24 19:48 arka 阅读(202) 评论(0)  编辑  收藏 所属分类: Eclipse FAQ

只有注册用户登录后才能发表评论。


网站导航: