I need to set GDK_BACKEND=x11 prior to launching Eclipse, because of https://bugs.kde.org/show_bug.cgi?id=389495.

I tried the following in the .desktop file:

Exec=GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse
Exec=env GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse
Exec=export GDK_BACKEND=x11; /home/glodt/Software/eclipse-4.7/eclipse

but none of them yield the expected result.

When I launch Eclipse from the command-line like this it works:

GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse

How can I set this environment variable in the desktop file ?

  • You could try Exec=/usr/bin/env GDK_BACKEND=x11 home/glodt/Software/eclipse-4.7/eclipse, but since I don't run KDE I can't really test it.
    – Kusalananda
    Feb 26, 2018 at 7:38
  • Thanks for the hint. It mkes no differences unfortunaltely.
    – yglodt
    Feb 26, 2018 at 8:22
  • Did you found the solution?
    – Finn
    Oct 18, 2019 at 10:46

2 Answers 2


This worked for me, as @Kusalananda mentioned in the comments:

Exec=/usr/bin/env VAR=value command


env - run a program in a modified environment
env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]

You can try this:

Exec=bash -c "GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse"

you can also try sh

Exec=sh -c "GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse"

I'm not sure whether you need Terminal=true

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .