Ubuntu 18.04 XAMPP desktop icon “There was an error launching the application”

I created an icon on the desktop and entered the following code:

[Desktop Entry]
Encoding=UTF-8
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=gksudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Categories=Application
Type=Application
Terminal=false

When I launch the application I get “There was an error launching the application”

If I go into the terminal and type sudo /opt/lampp/manager-linux-x64.run, it works fine. I tried changing gksudo to sudo but that didn’t work either.

What am I doing wrong?

All topic