Sunday, November 1, 2009

Creating a Launcher for IntelliJ in Ubuntu

I had to do a bit of hunting to get this sorted out so I figured I'd put all the info in one place.

Since I'm going more Grails work lately I've been using IntelliJ IDEA 8.1 (haven't had a chance to check out the CFML plugin yet though), and after upgrading all my machines to Ubuntu 9.10 I figured I'd get fancy and add a launcher to my menus instead of starting things from the terminal.

Eclipse has a vm argument you can pass to the eclipse script when you launch things, but IntelliJ is a bit different. I found several solutions but most seemed to me to be unnecessarily complicated, but I kept hunting and stumbled across this snippet in the comment thread on this blog post, and it worked for me as the "command" line in the launcher properties.

/bin/sh -c "export JDK_HOME=/path/to/java&&/path/to/intellij/bin/"

Obviously you adjust "/path/to/java" and "/path/to/intellij" as appropriate to your setup.

Next I wanted to add a fancy icon and it turns out you can use the ones that come with IntelliJ. In the launcher properties, click the icon button and point to /path/to/intellij/bin, then hit "Browse." This will bring up the IntelliJ icons so you don't have to use a default Gnome coffee cup or something equally cheesy.

Hope that helps some other folks save a bit of hunting.

1 comment:

Mike Roberts said...

Thanks! Just what I needed. For any others reading this and trying to figure out where to start, click on Desktop Panel at the top of the screen, right click 'Add to Panel...' and choose 'Custom Application Launcher'.