如何将Java11(Java10)与Eclipse插件一起使用? [英] How to use Java11 (Java10) with Eclipse Plugin?
问题描述
如果我在Eclipse插件中将JavaSE-10指定为最低执行环境:
将我的插件作为Eclipse应用程序启动时出现以下错误:
org.osgi.framework.BundleException:无法解析模块:org.treez.core [597]
未解决的要求:要求-功能:osgi.ee; filter:=(&(osgi.ee = JavaSE)(version = 10))
未解决的要求:Require-Bundle:org.treez.javafxd3;可见性:= reexport
-> Bundle-SymbolicName:org.treez.javafxd3; bundle-version = 1.0.0.qualifier; singleton:= true
org.treez.javafxd3 [586]
未解决的要求:Require-Capability:osgi.ee; filter:=(&(osgi.ee = JavaSE)(version = 10))
在org.eclipse.osgi.container.Module.start(Module.java:444)
在org.eclipse.osgi.container.ModuleContainer $ ContainerStartLevel.incStartLevel(ModuleContainer.java:1634)
在org.eclipse.osgi.container.ModuleContainer $ ContainerStartLevel.incStartLevel(ModuleContainer.java:1613)
在org.eclipse.osgi.container.ModuleContainer $ ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585)
在org.eclipse.osgi.container.ModuleContainer $ ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528)
在org.eclipse.osgi.container.ModuleContainer $ ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
在org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)$ b org.eclipse.osgi.framework.eventmgr.EventManager $ EventThread.run(EventManager.java:340)中的
$ b
我检查了
- Java10是reverenc
- 10被选择为合规级别
我使用Oxygen.3a版本(4.7.3a)内部版本号:20180405-1200
=>这是蚀春分的错误吗?
=>我还能检查什么来解决此问题?
如果我从最低执行环境设置中删除JavaSE-10,则可以启动Eclipse应用程序,并且插件似乎可以正常工作。
导出时我收到以下警告的插件:
#25.04.18,12:25:40 MESZ
#Eclipse编译器Java(TM)v20180330-0919,3.13.12,版权所有IBM Corp 2000,2015。保留所有权利。
选项-bootclasspath在法规遵从性级别9及更高级别不支持
当我尝试使用从更新页面安装插件后,我得到ClassNotFoundException:
...
原因:java。 lang.ClassNotFoundException:org.treez.views_1.0.0.201804191641
在org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)找不到org.treez.views.tree.TreeViewPart )
在org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
在org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387 )
在org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
在java.base / java.lang.ClassLoader.loadClass(ClassLoader.java:499)
在org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564)
在org.eclipse.core.internal.registry.osgi.RegistryStrategy OSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
... 114更多
如果我使用Java8一切正常。
相关问题:
-
(因此,我认为在导出向导的编译步骤中如果出现问题,
我使用了Java 11.0.1和Eclipse SimRel 2018-09(加上Java11支持插件)
If I specify JavaSE-10 as minimum execution environment in my Eclipse plugin:
I get following errors when starting my plugin as Eclipse Application:
org.osgi.framework.BundleException: Could not resolve module: org.treez.core [597] Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=10))" Unresolved requirement: Require-Bundle: org.treez.javafxd3; visibility:="reexport" -> Bundle-SymbolicName: org.treez.javafxd3; bundle-version="1.0.0.qualifier"; singleton:="true" org.treez.javafxd3 [586] Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=10))" at org.eclipse.osgi.container.Module.start(Module.java:444) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1613) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
I checked that
- Java10 is reverenced under Installed JREs
- 10 is selected as compliance level
I use Oxygen.3a Release (4.7.3a) Build id: 20180405-1200
=>Is this a bug in eclipse equinox?
=>What else can I check to resolve this issue?
If I remove JavaSE-10 from the minimum execution environment settings I am able to start the Eclipse Application and the plugin seems to work fine.
When I export the plugin I get following warning:
# 25.04.18, 12:25:40 MESZ # Eclipse Compiler for Java(TM) v20180330-0919, 3.13.102, Copyright IBM Corp 2000, 2015. All rights reserved. option -bootclasspath not supported at compliance level 9 and above
When I try to use the plugin after installing it from my update page, I get a ClassNotFoundException:
... Caused by: java.lang.ClassNotFoundException: org.treez.views.tree.TreeViewPart cannot be found by org.treez.views_1.0.0.201804191641 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174) ... 114 more
If I use Java8 everything works fine.
Related questions:
解决方案What worked for me as a work around was to
Remove the required version entries from the manifest files and ignore the corresponding warnings
Activate the option "Use class files compiled in the workspace" in the export wizard:
(Therefore I assume that something goes wrong during the compilation step of the export wizard if that option is not applied.)
I used Java 11.0.1 and Eclipse SimRel 2018-09 (plus Java11 support plugin)
这篇关于如何将Java11(Java10)与Eclipse插件一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!