11 September 2012

IntelliJ IDEA Community Edition on Arch Linux

or, The Best Java IDE on the Best Operating System


Why IntelliJ IDEA

If you're writing Java, IntelliJ IDEA is the only IDE worth using.

The interface is sensible and snappy.
Navigating projects is easy.
It gives you immediate code suggestions and completions, intelligently and unobtrusively.
It integrates with your favourite DVCS.
It has bundled Android tools and handles XML nicely.
The Community Edition is open-source and cross-platform.

Compare this with buggy Eclipse, bloated NetBeans, and all those other small and incomplete or poorly supported IDEs, and what more do I need to say?

Why Arch

Arch Linux is one of those things that you either love or hate.  From its wiki:

"Arch Linux is a versatile and simple distribution designed to fit the needs of the competent Linux user. It is both powerful and easy to manage, making it an ideal distro for servers and workstations. Take it in any direction you like."

If this doesn't sound like your cup of tea, don't bother.  If it does though, go install it right now and you'll never look back.  Be warned though, initial configuration can be a daunting task.

Installing

To install IntelliJ IDEA on Windows, just get the installer from the official page.

On Arch there are some quirks, so here's a walkthrough.

First you need Oracle's implementation of Java from the Arch User Repository.  If you have OpenJDK installed, you'll need to remove it first.  For OpenJDK 7:
pacman -Rdd jre7-openjdk jre7-openjdk-headless jdk7-openjdk

Now jre and jdk need to be installed from AUR.  I recommend using a tool like yaourt:
yaourt -S jre jdk

Next, IntelliJ IDEA:
pacman -S intellij-idea-community-edition

Finally you need to edit the launcher script, found by which idea.sh, to include these lines before the last one:
export PATH=$PATH:/opt/java/bin:/opt/java/jre/bin
export JAVA_HOME=${JAVA_HOME:-/opt/java}


Et voilĂ !  Just launch IntelliJ IDEA from the applications menu, or from a terminal with idea.sh.

On an unrelated note, I am growing to like Cinnamon as my desktop environment.