当前位置:  开发笔记 > 编程语言 > 正文

Eclipse在Ubuntu上冻结了UI

如何解决《Eclipse在Ubuntu上冻结了UI》经验,为你挑选了3个好方法。

我最近安装了ubuntu 16.04(自动更新到这个版本),我通常用Java开发,我知道eclipse,所以我安装它,一切都很好.

我配置了所需的一切(Java路径,JDK ......没什么特别的),工作正常,除了Eclipse UI.

每次我创建一个项目时UI都会冻结(虽然项目是正确创建的),每次我运行任何程序时(尽管程序运行正常(不总是正确的xD,但这是我的错)),以及许多其他任务.

知道为什么会这样吗?甚至更好,如何解决?

我还仔细检查了我使用的JRE(因为我发现人们遇到了开源软件的问题),我使用的是oracle的版本(现在还不确定这个名字,抱歉,版本8).它是64位版本的一切.

编辑:我忘了提到我使用火星版.另外,我刚刚安装了NetBeans(8.1),完全相同的问题,然后我认为这是图形驱动程序的问题,再次安装,仍然有同样的问题.不知道现在该尝试什么.

更新:检查日志文件.我觉得没什么奇怪的,但可能会遗漏一些东西:

!SESSION 2015-12-04 13:24:38.930     -----------------------------------------------
 eclipse.buildId=4.5.1.M20150904-0015
 java.version=1.8.0_66
 java.vendor=Oracle Corporation
 BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=es_ES
 Command-line arguments:  -os linux -ws gtk -arch x86_64

 !ENTRY org.eclipse.core.resources 2 10035 2015-12-04 13:24:40.542
 !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

更新2:我只是运行@dan建议的命令.这是结果

 "main" #1 prio=6 os_prio=0 tid=0x00007f0ec000a000 nid=0x26e0 runnable [0x00007f0ec9a18000]
   java.lang.Thread.State: RUNNABLE
    at org.eclipse.swt.internal.gtk.OS._gtk_widget_get_allocation(Native Method)
    at org.eclipse.swt.internal.gtk.OS.gtk_widget_get_allocation(OS.java:14234)
    at org.eclipse.swt.widgets.Control.getBounds(Control.java:832)
    at org.eclipse.jface.fieldassist.ControlDecoration.getDecorationRectangle(ControlDecoration.java:1185)
    at org.eclipse.jface.fieldassist.ControlDecoration$3.paintControl(ControlDecoration.java:635)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230)
    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.Widget.sendEvent(Widget.java:1353)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1338)
    at org.eclipse.swt.widgets.Control.gtk_draw(Control.java:3219)
    at org.eclipse.swt.widgets.Canvas.gtk_draw(Canvas.java:171)
    at org.eclipse.swt.widgets.Shell.gtk_draw(Shell.java:1306)
    at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1942)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:5590)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4717)
    at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
    at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9279)
    at org.eclipse.swt.widgets.Display.eventProc(Display.java:1225)
    at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
    at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2425)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3428)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:172)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:387)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1002)
    at org.eclipse.jdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:134)
    at org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard.performFinish(NewClassCreationWizard.java:80)
    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:799)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:429)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    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.jface.window.Window.runEventLoop(Window.java:827)
    at org.eclipse.jface.window.Window.open(Window.java:803)
    at org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction.run(WizardShortcutAction.java:99)
    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:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    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:497)
    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)

   Locked ownable synchronizers:
    - None

Zoltán Ujhel.. 14

Linux上的Eclipse UI默认使用GTK 3来显示内容,但我发现经常出现问题.我不确定这是否是问题的根源,但您可以通过使用环境变量设置禁用GTK 3支持来检查它:export SWT_GTK3=0.但是,在您发现之前,这是问题的根源,我不会永久打开它.



1> Zoltán Ujhel..:

Linux上的Eclipse UI默认使用GTK 3来显示内容,但我发现经常出现问题.我不确定这是否是问题的根源,但您可以通过使用环境变量设置禁用GTK 3支持来检查它:export SWT_GTK3=0.但是,在您发现之前,这是问题的根源,我不会永久打开它.



2> Mayuso..:

我已经发现了这个问题.正如佐尔坦和丹指出的那样,GTK就是问题所在.

解决方案:(仅在Eclipse上测试):

    转到窗口>首选项>常规>外观.

    为您喜欢的任何其他主题更改"GTK"主题.

这解决了我的问题.



3> dan..:

您应该生成eclipse进程的java线程转储,例如:

    建立进程ID:

    jps -lv
    

    识别代表eclipse实例的行,并记住该行的第一个数字,即进程ID.

    使用进程ID触发线程转储:

    jstack -l process_id > jstack.out
    

这样,您将获得当时JVM处于活动状态的每个线程的堆栈跟踪.从这里你应该能够确定你的程序没有运行的原因.

推荐阅读
贾志军
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有