如何使用openJDK11运行Eclipse? [英] How to run Eclipse with openJDK11?
问题描述
eclipse.ini
看起来如何使Eclipse(Photon,2018-09或2018-12)在openJDK11上运行?
How must eclipse.ini
look like to make Eclipse (Photon, 2018-09 or 2018-12) run on openJDK11?
我已经安装了openJDK 11.0.1和Eclipse 2018-09.我有一个带有XML jar的文件夹(Eclipse似乎需要):
I have installed openJDK 11.0.1 and Eclipse 2018-09. I have a folder with XML jars (which seem to be required by Eclipse):
javax.xml.libs/
javax.activation-1.2.0.jar
jaxb-api-2.3.1.jar
jaxb-core-2.3.0.1.jar
jaxb-impl-2.3.1.jar
我修改了 eclipse.ini
以使用jdk和库:
I have modified eclipse.ini
to use the jdk and the libs:
-startup
plugins/org.eclipse.equinox.launcher_1.5.100.v20180827-1352.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.800.v20180827-1352
-product
org.eclipse.epp.package.java.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
D:/bin/jdk-11.0.1/bin
-vmargs
-cp D:/bin/javax.xml.libs/*
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-DEFAULT,ALL-SYSTEM
# --add-opens=org.eclipse.mylyn.bugzilla.core
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx1024m
启动Eclipse可以运行,但是会在 workspace/.metadata/.log
中导致以下错误.从 eclipse.ini
中的第21行删除注释将使Eclipse根本无法启动.我在做什么错了?
Starting Eclipse works but leads to the following errors in workspace/.metadata/.log
. Removing the comment from line 21 in eclipse.ini
prevents Eclipse from starting at all. What am I doing wrong?
!SESSION 2018-12-18 11:59:04.814 -----------------------------------------------
eclipse.buildId=4.9.0.I20180906-0745
java.version=11.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.mylyn.bugzilla.core 4 0 2018-12-18 11:59:06.177
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.mylyn.bugzilla.core [282]
Unresolved requirement: Require-Bundle: org.eclipse.mylyn.commons.xmlrpc; bundle-version="[3.8.0,4.0.0)"
-> Bundle-SymbolicName: org.eclipse.mylyn.commons.xmlrpc; bundle-version="3.24.2.v20180904-2231"; singleton:="true"
org.eclipse.mylyn.commons.xmlrpc [299]
Unresolved requirement: Require-Bundle: org.apache.xmlrpc; bundle-version="[3.0.0,4.0.0)"
-> Bundle-SymbolicName: org.apache.xmlrpc; bundle-version="3.0.0.v20100427-1100"
org.apache.xmlrpc [71]
Unresolved requirement: Import-Package: javax.xml.bind
Unresolved requirement: Require-Bundle: org.apache.xmlrpc
-> Bundle-SymbolicName: org.apache.xmlrpc; bundle-version="3.0.0.v20100427-1100"
at org.eclipse.osgi.container.Module.start(Module.java:447)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1685)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1664)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1627)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1558)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:233)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:343)
!ENTRY org.eclipse.mylyn.bugzilla.ui 4 0 2018-12-18 11:59:06.199
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.mylyn.bugzilla.ui [284]
Unresolved requirement: Require-Bundle: org.eclipse.mylyn.bugzilla.core; bundle-version="[3.8.0,4.0.0)"
-> Bundle-SymbolicName: org.eclipse.mylyn.bugzilla.core; bundle-version="3.24.2.v20180905-0003"; singleton:="true"
org.eclipse.mylyn.bugzilla.core [282]
Unresolved requirement: Require-Bundle: org.eclipse.mylyn.commons.xmlrpc; bundle-version="[3.8.0,4.0.0)"
-> Bundle-SymbolicName: org.eclipse.mylyn.commons.xmlrpc; bundle-version="3.24.2.v20180904-2231"; singleton:="true"
org.eclipse.mylyn.commons.xmlrpc [299]
Unresolved requirement: Require-Bundle: org.apache.xmlrpc; bundle-version="[3.0.0,4.0.0)"
-> Bundle-SymbolicName: org.apache.xmlrpc; bundle-version="3.0.0.v20100427-1100"
org.apache.xmlrpc [71]
Unresolved requirement: Import-Package: javax.xml.bind
Unresolved requirement: Require-Bundle: org.apache.xmlrpc
-> Bundle-SymbolicName: org.apache.xmlrpc; bundle-version="3.0.0.v20100427-1100"
at org.eclipse.osgi.container.Module.start(Module.java:447)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1685)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1664)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1627)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1558)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:233)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:343)
!ENTRY org.eclipse.mylyn.commons.xmlrpc 4 0 2018-12-18 11:59:06.223
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.mylyn.commons.xmlrpc [299]
Unresolved requirement: Require-Bundle: org.apache.xmlrpc; bundle-version="[3.0.0,4.0.0)"
-> Bundle-SymbolicName: org.apache.xmlrpc; bundle-version="3.0.0.v20100427-1100"
org.apache.xmlrpc [71]
Unresolved requirement: Import-Package: javax.xml.bind
at org.eclipse.osgi.container.Module.start(Module.java:447)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1685)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1664)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1627)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1558)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:233)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:343)
!ENTRY org.eclipse.mylyn.tasks.core 4 0 2018-12-18 11:59:11.498
!MESSAGE Unexpected error while loading repository template extensions
!SUBENTRY 1 org.eclipse.mylyn.tasks.core 4 0 2018-12-18 11:59:11.498
!MESSAGE Could not load repository template extension contributed by 'org.eclipse.mylyn.bugzilla.ide' with connectorKind 'bugzilla'
!ENTRY org.eclipse.ui 4 0 2018-12-18 11:59:18.414
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at org.eclipse.ui.internal.intro.impl.model.url.IntroURL.switchToLaunchBar(IntroURL.java:675)
at org.eclipse.ui.internal.intro.impl.model.url.IntroURL.doExecute(IntroURL.java:211)
at org.eclipse.ui.internal.intro.impl.model.url.IntroURL.lambda$0(IntroURL.java:146)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
at org.eclipse.ui.internal.intro.impl.model.url.IntroURL.execute(IntroURL.java:146)
at org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartLocationListener.changing(BrowserIntroPartLocationListener.java:130)
at org.eclipse.swt.browser.IE.lambda$6(IE.java:525)
at org.eclipse.swt.ole.win32.OleEventTable.sendEvent(OleEventTable.java:58)
at org.eclipse.swt.ole.win32.OleEventSink.notifyListener(OleEventSink.java:160)
at org.eclipse.swt.ole.win32.OleEventSink.Invoke(OleEventSink.java:128)
at org.eclipse.swt.ole.win32.OleEventSink.access$1(OleEventSink.java:105)
at org.eclipse.swt.ole.win32.OleEventSink$1.method6(OleEventSink.java:79)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:122)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2309)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3559)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:628)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:199)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:391)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:246)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
!ENTRY org.eclipse.core.jobs 4 2 2018-12-18 12:04:15.682
!MESSAGE An internal error occurred during: "Polling news feeds".
!STACK 0
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
at org.eclipse.mylyn.internal.commons.notifications.feed.FeedReader.parse(FeedReader.java:52)
at org.eclipse.recommenders.news.impl.poll.DefaultFeedItemStore.parseNewsItems(DefaultFeedItemStore.java:135)
at org.eclipse.recommenders.news.impl.poll.DefaultFeedItemStore.udpate(DefaultFeedItemStore.java:53)
at org.eclipse.recommenders.news.impl.poll.DefaultNewsPollingService.fallbackToLocalStore(DefaultNewsPollingService.java:136)
at org.eclipse.recommenders.news.impl.poll.DefaultNewsPollingService.poll(DefaultNewsPollingService.java:104)
at org.eclipse.recommenders.news.impl.poll.DefaultNewsPollingService.poll(DefaultNewsPollingService.java:64)
at org.eclipse.recommenders.internal.news.rcp.poll.PollFeedsJob.run(PollFeedsJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext cannot be found by org.eclipse.mylyn.commons.notifications.feed_1.16.0.v20180904-2231
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 8 more
!ENTRY org.eclipse.core.jobs 4 2 2018-12-18 12:09:15.684
!MESSAGE An internal error occurred during: "Polling news feeds".
!STACK 0
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
at org.eclipse.mylyn.internal.commons.notifications.feed.FeedReader.parse(FeedReader.java:52)
at org.eclipse.recommenders.news.impl.poll.DefaultFeedItemStore.parseNewsItems(DefaultFeedItemStore.java:135)
at org.eclipse.recommenders.news.impl.poll.DefaultFeedItemStore.udpate(DefaultFeedItemStore.java:53)
at org.eclipse.recommenders.news.impl.poll.DefaultNewsPollingService.fallbackToLocalStore(DefaultNewsPollingService.java:136)
at org.eclipse.recommenders.news.impl.poll.DefaultNewsPollingService.poll(DefaultNewsPollingService.java:104)
at org.eclipse.recommenders.news.impl.poll.DefaultNewsPollingService.poll(DefaultNewsPollingService.java:64)
at org.eclipse.recommenders.internal.news.rcp.poll.PollFeedsJob.run(PollFeedsJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
推荐答案
此错误是由Mylyn Bugzilla连接器使用Java 6中引入的 javax.xml.bind
包中的类引起的.,但已在Java 11中删除(请参阅: JEP 320:删除Java EE和CORBA模块)
This bug is caused by the Mylyn Bugzilla connector using classes of the javax.xml.bind
package that has been introduced in Java 6, but removed in Java 11 (see: JEP 320: Remove the Java EE and CORBA Modules).
在Eclipse中,Bugzilla连接器用于以下功能,这些功能在每次启动Eclipse时都会记录以下错误:
In Eclipse, the Bugzilla connector is used for the following features that are broken when the mentioned error is logged each time Eclipse is started:
- 帮助>报告错误或增强功能...
- 搜索>搜索... ,选项卡任务搜索
- Help > Report Bug or Enhancement...
- Search > Search..., tab Task Search
不幸的是,此 bug在Eclipse 2018-12中的某些IDE软件包中仍然存在,其中包括您使用的面向Java开发人员的Eclipse IDE (在日志中显示为 -product org.eclipse.epp.package.java.product
).
Unfortunately, this bug still exists in Eclipse 2018-12 in some of the IDE packages, including the Eclipse IDE for Java Developers you use (in your log as -product org.eclipse.epp.package.java.product
).
使用以下方法之一作为变通方法(已在Eclipse 2018-12中进行了测试):
Use one of the following as a workaround (tested with Eclipse 2018-12):
- 使用 Java 8、9或10运行Eclipse ,但在窗口>首选项:Java>已安装的JRE 使用Java 11 JDK
- 使用 用于企业Java开发人员的Eclipse IDE ,而不是用于Java开发人员的Eclipse IDE
- 从 Eclipse Orbit 中复制以下JAR放入Eclipse 2018-12 IDE的
dropins
文件夹:- Use Java 8, 9 or 10 to run Eclipse, but in Window > Preferences: Java > Installed JREs use a Java 11 JDK
- Use the Eclipse IDE for Enterprise Java Developers instead of the Eclipse IDE for Java Developers
- Copy the following JARs from Eclipse Orbit into the
dropins
folder of your Eclipse 2018-12 IDE:- javax.xml.bind 2.2.0
- javax.activation 1.1.0
- javax.xml 1.3
有关详细信息,请参阅Eclipse cross-project-issues-dev邮件列表此处.
For details see my (for 2018-12 unfortunately too late) mails on the Eclipse cross-project-issues-dev mailing list here and here.
这篇关于如何使用openJDK11运行Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!