0

I trying to run IDEA from dash menu. So I've create .desktop file for it and put it to /usr/share/applications:

$ cat /usr/share/applications/idea.desktop
[Desktop Entry]
Name=IDEA
Comment=IntelliJ IDEA
Exec=/opt/idea/bin/idea.sh
Icon=/opt/idea/bin/idea.png
Terminal=0
Type=Application
Encoding=UTF-8
Categories=Development;IDE;Java;

$ ls -l /usr/share/applications/idea.desktop
-rw-rw-r-- 1 root root 179 Oct  3 11:01 /usr/share/applications/idea.desktop

When I type idea in dash I can see IDEA's icon, but when I click on it application not start. In the same time if i run /opt/idea/bin/idea.sh from console, it will run.

How to solve (or debug) this problem?

php-coder
  • 103

2 Answers2

2

Possibly, you are missing some environment variables. Maybe some entries in your $PATH? How about the following. Create a script, say /home/user/testidea.sh (where user is your actual username, of course), containing

#!/bin/bash

/opt/idea/bin/idea.sh 2> /tmp/idea.err > /tmp/idea.out

Make it executable

chmod a+x /home/user/testidea.sh

And replace the respective line in the idea.desktop file by

exec=/home/user/testidea.sh

Maybe that will work, but if not, at least (hopefully) you will find what is wrong by inspecting /tmp/idea.err and /tmp/idea.out.

January
  • 35,952
  • Thanks for idea, it was really helpful. In log file i found cause of error: No JDK found. Please validate either IDEA_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation. I've just add export JDK_HOME=/opt/jdk to IDEA's startup script and now it works. – php-coder Oct 29 '12 at 07:52
0

In order to start debugging you can try to run the desktop file from command-line and see the response. The topic of how to cover this seems to be covered in this post. The particular solution to try might be using gnome-open to see the result but apparently that might not work :(

Second thing to try is if the desktop file works while double clicking from desktop or nautilus?

Finally i found this page about UnityLaunchersAndDesktopFiles which goes into more detail abt this. Particularly, it suggests you use the desktop file validator to check if the file is valid.

Karthik T
  • 2,031