Thursday, November 14, 2013

How to add a Unity Launcher for Intellij IDEA

This has been annoying me for the past two days.  I couldn't figure out how to edit the Intellij IDEA launcher after upgrading to the latest version of IDEA.  After playing around a bit and getting things working, I figured I'd post this so that I remember for the next upgrade (i.e. IDEA 13 is right around the corner).

Fire up Intellij IDEA

$ ~/apps/idea-IU-129.1359/bin/idea.sh

Create desktop entry (I always forget about this option)

Tools > Create desktop entry ...
(check the "Create entry for all users" checkbox so that the .desktop file is saved to /usr/share/applications)


Update .desktop file when you upgrade to a new version of Intellij IDEA

Different versions of IDEA create launchers with different names, so your file might have been saved as something else.  But for Intellij IDEA 12.1.6 Build 129.1359 the new desktop file is called jetbrains-idea.desktop.

If you ever lose that launcher or need to upgrade to a new version of Intellij IDEA, you can edit
$ sudo gedit /usr/share/applications/jetbrains-idea.desktop

/usr/share/applications/jetbrains-idea.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA
Icon=/home/jmiranda/apps/idea-IU-129.1359/bin/idea.png
Exec="/home/jmiranda/apps/idea-IU-129.1359/bin/idea.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-idea

If, for some reason, you click on the launcher and it doesn't launch, you may need to make the .desktop file executable.
$ sudo chmod +x /usr/share/applications/jetbrains-idea.desktop


Monday, November 11, 2013

How to disable a service in Ubuntu ...

$ sudo update-rc.d tomcat7 disable
update-rc.d: warning: tomcat7 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: tomcat7 stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
 Disabling system startup links for /etc/init.d/tomcat7 ...
 Removing any system startup links for /etc/init.d/tomcat7 ...
   /etc/rc0.d/K08tomcat7
   /etc/rc1.d/K08tomcat7
   /etc/rc2.d/S92tomcat7
   /etc/rc3.d/S92tomcat7
   /etc/rc4.d/S92tomcat7
   /etc/rc5.d/S92tomcat7
   /etc/rc6.d/K08tomcat7
 Adding system startup for /etc/init.d/tomcat7 ...
   /etc/rc0.d/K08tomcat7 -> ../init.d/tomcat7
   /etc/rc1.d/K08tomcat7 -> ../init.d/tomcat7
   /etc/rc6.d/K08tomcat7 -> ../init.d/tomcat7
   /etc/rc2.d/K08tomcat7 -> ../init.d/tomcat7
   /etc/rc3.d/K08tomcat7 -> ../init.d/tomcat7
   /etc/rc4.d/K08tomcat7 -> ../init.d/tomcat7
   /etc/rc5.d/K08tomcat7 -> ../init.d/tomcat7