Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Mars Scrolling in Lubuntu

Tags:

eclipse

Just installed Eclipse Mars on Lubuntu 14. While scrolling up and down in the console or editor - I get a kind of black rectangle covering some text, or the test is kind of twisted visually (lines become non-straight). Anyone know how to fix this? Haven't had this in previous versions of Eclipse on the same comp.

like image 295
jreing Avatar asked Jul 01 '15 06:07

jreing


3 Answers

Exactly the same thing happened to me installing Eclipse Mars on Lubuntu 14 Toshiba Satellite notebook. I was really looking forward to the day of the Eclipse annual release of Mars and I was disappointed to be so disappointed with 5 minutes on installing.

Anyway, I can confirm that setting environment variable SWT_GTK3=0 by way of export does circumvent the problem. If you open a terminal and type "export SWT_GTK3=0" in the shell, you will also need to start Eclipse via the command line while remaining in the same shell. If you start Eclipse via a desktop launch icon, Eclipse will not see the SWT_GTK3 environment variable and the problem will persist. This is because environment variables in Linux are per-process and an application launched from the desktop is running in a different process to a shell process in a terminal.

So that Eclipse always sees the correct SWT_GTK3 environment variable after starting your machine, best you export SWT_GTK3=0 globally. To do this on Lubuntu, follow these steps:

  1. Open a terminal window
  2. Open the file /etc/profile for editing as sudo (e.g. sudo gedit /etc/profile)
  3. Add the line export SWT_GTK3=0 at the end of the file.
  4. Save file, quit editor and reboot your machine.
  5. Launch Eclipse Mars and hopefully your scrolling problem is fixed.

This worked for me but, as always, YMMV.

btw. You can check the SWT-GTK3 environment variable was exported after rebooting by opening a terminal window and typing the 'env' command. You should see SWT_GTK3=0 in the list of environment variables and values that are displayed.

like image 77
Martian Odyssey Avatar answered Nov 06 '22 03:11

Martian Odyssey


It seems like a new bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=469027

It happens also under Kubuntu. Anyway the workaround, at least for me, is to export the following environment variable:

SWT_GTK3=0

like image 41
apetrelli Avatar answered Nov 06 '22 04:11

apetrelli


I solved my problem in Ubuntu 15.04 with Eclipse Mars by adding the following code in the start of data in the Exec option in eclipse.desktop (/home/.local/share/applications):

Exec=env UBUNTU_MENUPROXY=0 SWT_GTK3=0 /usr/lib/jvm/...

In that way you leave intact your OS preferences and act only on Eclipse starting script.

like image 45
user2342558 Avatar answered Nov 06 '22 04:11

user2342558