【问题标题】:Eclipse cant create new java projectsEclipse 无法创建新的 java 项目
【发布时间】:2016-04-07 21:11:36
【问题描述】:

我在 openSUSE Tumbleweed 上运行 Eclipse 4.5.2 (Mars)。不幸的是,我无法创建 Java 项目,因为单击 new->Java Projects 后,什么也没有发生...

我已经重新安装了 eclipse,清除了元数据,从我的主目录中删除了用户数据。没有任何效果。

我刚刚在我的日志中收到以下错误消息: name= 未处理的事件循环异常;插件= org.eclipse.ui;

异常堆栈跟踪:

ava.lang.NullPointerException
at org.eclipse.swt.widgets.TabFolder.gtk_switch_page(TabFolder.java:570)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2009)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4723)
at org.eclipse.swt.internal.gtk.OS._gtk_widget_show(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_widget_show(OS.java:14774)
at org.eclipse.swt.widgets.TabFolder.createItem(TabFolder.java:311)
at org.eclipse.swt.widgets.TabItem.createWidget(TabItem.java:123)
at org.eclipse.swt.widgets.TabItem.<init>(TabItem.java:75)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.createControl(BuildPathsBlock.java:228)
at org.eclipse.jdt.ui.wizards.JavaCapabilityConfigurationPage.createControl(JavaCapabilityConfigurationPage.java:162)
at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:175)
at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:705)
at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:597)
at org.eclipse.jface.window.Window.create(Window.java:430)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1096)
at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:123)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1329)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3819)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3430)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

堆栈跟踪

eclipse.buildId=4.5.2.M20160212-1500
java.version=1.8.0_77
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Command-line arguments:  -data file:/home/andi/workspace/eclipse/ -os linux -ws gtk -arch x86_64

非常感谢您的帮助!

【问题讨论】:

    标签: java linux eclipse opensuse


    【解决方案1】:

    您尚未指定运行 Eclipse 的桌面环境(KDE、GNOME、LXDE),无论如何 Eclipse 似乎是not to be very compatible with the new GTK3

    我解决了强制 eclipse 使用 GTK2 的问题,您可以在 eclipse.ini 文件中添加以下两行:

    --launcher.GTK_version
    2
    

    确保在--launcher.appendVmargs 行上方添加两行。

    【讨论】:

    • 非常感谢!这样可行!对于其他有同样问题的人,您可以在“/usr/lib64/eclipse/”或“/usr/lib/eclipse/”中找到eclipse.ini。您必须在“--launcher.appendVmargs”行上方添加两行。
    • 也适合我! Eclipse Mars 2 for Java EE
    • 仅供参考:确保在-vmargs之前添加行!祝那些正在与日食斗争的人万事如意。
    • 在我的例子中是 /opt/eclipse-sdk-bin-4.5/eclipse.ini 。用户主目录中是否有 eclipse.ini 或类似的东西?
    • 我在 64 位 Ubuntu 16.04 上遇到了同样的问题。该修复对我有用,表明该问题及其修复并非特定于 openSUSE。谢谢。
    猜你喜欢
    • 2012-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    • 1970-01-01
    • 2015-12-11
    • 1970-01-01
    相关资源
    最近更新 更多