Search code examples
linuxeclipseubuntustack-overflow

Eclipse Neon "Customize perspective" provokes a "StackOverflowError"


Eclipse "Customize perspective" provokes a "StackOverflowError" (see partial stacktrace below), the screen will never show and Eclipse can become unstable and may not start again.

This happens on Spring Tool Suite (sts-3.8.3) based on Eclipse 4.6.2 running on Ubuntu 16.x (and probably on other Linux too).

How to unlock Eclipse and how to make "Custom perspective" work with this version ?

stacktrace :

java.lang.StackOverflowError
at org.eclipse.swt.events.ControlEvent.<init>(ControlEvent.java:35)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:225)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5227)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1340)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1366)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1345)
at org.eclipse.swt.widgets.Control.setBounds(Control.java:1100)
at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1527)
at org.eclipse.swt.widgets.ToolBar.setBounds(ToolBar.java:589)
at org.eclipse.swt.widgets.Control.setLocation(Control.java:1187)
at org.eclipse.e4.ui.widgets.ImageBasedFrame.setFramedControlLocation(ImageBasedFrame.java:124)
at org.eclipse.e4.ui.widgets.ImageBasedFrame.access$0(ImageBasedFrame.java:120)
at org.eclipse.e4.ui.widgets.ImageBasedFrame$4.controlMoved(ImageBasedFrame.java:109)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:225)
(...)

Solution

  • If Eclipse is locked, it's not useful to remove the "writer.lock" file visible in logs, you have to remove the "workbench.xmi" located in your workspace :

    <workspace_path>/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
    

    (tip taken here : Eclipse (C/C++) Error: Job found still running after platform shutdown)

    To enable the "Customize perspective" screen, you have to switch to GTK 2. To do so, just edit your eclipse.ini (or STS.ini) and replace this :

    --launcher.defaultAction
    

    by this :

    --launcher.GTK_version
    2