Update Launcher for Intellij IDEA in Ubuntu

I currently have IntelliJ IDEA 15.01 on my system. I recently downloaded Intellij IDEA 15.04. After running the idea.sh script to open it, I went to the tools menu, and created the desktop launcher. After closing IDEA, I tried to open it with the launcher, which instead opened IDEA 15.01. After that, I tried opening IDEA using the launcher in /usr/share/applications (which is working correctly) and then pinning the corresponding launcher to the desktop. The launcher works correctly until I restart my computer. After I restart, the launcher reverts to opening IDEA 15.01.

How do I fix this?

IDEA install directory: /home/thenumberone/idea-IC-143.2287.1/

Contents of /usr/share/applications/jetbrains-idea-ce.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Community Edition
Icon=/home/thenumberone/idea-IC-143.2287.1/bin/idea.png
Exec="/home/thenumberone/idea-IC-143.2287.1/bin/idea.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea-ce

To update the launcher when you upgrade IntelliJ:

  1. Close all OLD Intellij instances

  2. Remove OLD Intellij shortcut from launcher (right click -> Unlock from launcher)

  3. Run

    rm ~/.local/share/applications/jetbrains-idea.desktop
    rm ~/.gnome/apps/jetbrains-idea.desktop
    sudo rm /usr/local/bin/idea
    sudo rm /usr/share/applications/jetbrains-idea.desktop
    
  4. Open NEW Intellij by going to NEWIntellij home dir and running bin/idea.sh

  5. Tools -> Create desktop entry

  6. Lock new icon to launcher (right click -> lock to launcher or add to favourites in new Ubuntu versions)

If the launcher icon won't remain after closing Intellij

  1. rm ~/.local/share/applications/jetbrains-idea.desktop
  2. Open Intellij -> Tools -> Create desktop entry
  3. Right click on Intellij launcher icon -> lock to launcher (or add to favourites in new Ubuntu versions)

The cause

I am 100% sure you still have a local idea 15.01 launcher in ~/.local/share/applications/jetbrains-idea-ce.desktop.

If you drag the global one (/usr/share/applications/jetbrains-idea-ce.desktop) on to the launcher, you temporarily "force" the Unity Launcher to work with the global one, but the local one overrules the global one on restart (log in).

What to do?

Simply remove the local .desktop file in ~/.local/share/applications, log out and back in.


A simpler manner is:

  1. Remove all old IntelliJ shortcuts.
  2. Go the new version of your IntelliJ at INTELLIJ_DIRECTORY/bin via command line, and execute ./idea.sh
  3. In the IDE, to go Tools -> Create Desktop Entry...
  4. Confirm the creation if asked
  5. Log off and login
  6. In the Unity menu look for IntelliJ, launch it and, on the left side panel where you see your IntelliJ icon, click "Lock to Launcher".

That's it.


So I run into this issue recently and I found another alternative which was much simpler.

  1. First, create a symbolic link to your new IntelliJ IDE in the Applications directory or the folder you normally keep your IDE applications. Example ln -s idea-IC-[version.number.here] IntelliJ
  2. Open the local desktop launcher file(~/.local/share/applications/jetbrains-idea-ce.desktop) with your favorite editor eg nano, vi, gedit, etc.
  3. Modify the Icon field (approx line 5) and the Exec field (approx line 6) to point to the appropriate files under the bin in path where you created the symbolic link above. Your file should now look like this:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=IntelliJ IDEA Community Edition
    Icon=/home/rhycce/Applications/IntelliJ/bin/idea.png
    Exec="/home/rhycce/Applications/IntelliJ/bin/idea.sh" %f
    Comment=The Drive to Develop
    Categories=Development;IDE;
    Terminal=false
    StartupWMClass=jetbrains-idea-ce
    
  4. Save and Done!

From now on, after downloading any IDE update, all you have to do is update the symbolic link to point to the new update folder and you are good.