Improved IntelliJ IDEA startup script for Linux

Here is an improved version of the IntelliJ IDEA startup script distributed along with the tar.gz for Linux. Why am I saying it is an improvement? Because this script will allow you to create symbolic links to it, so you can have it in your PATH without having yo set/alter other environment variables:

if [ -z "$IDEA_HOME" -o ! -d "$IDEA_HOME" ] ; then
   PRG="$0"
   progname=`basename "$0"`

   while [ -h "$PRG" ] ; do
       ls=`ls -ld "$PRG"`
       link=`expr "$ls" : '.*-> \(.*\)$'`
       if expr "$link" : '/.*' > /dev/null; then
           PRG="$link"
       else
           PRG=`dirname "$PRG"`"/$link"
       fi
   done

   IDEA_HOME=`dirname "$PRG"`/..
   IDEA_HOME=`cd "$IDEA_HOME" && pwd`
fi

#IDEA_HOME=`dirname "$0"`/..
#IDEA_BIN_HOME=`dirname "$0"`
IDEA_BIN_HOME=$IDEA_HOME

REQUIRED_JVM_ARGS="-Xbootclasspath/p:$IDEA_HOME/lib/boot.jar: $IDEA_PROPERTIES_PROPERTY"

CLASSPATH=$IDEA_HOME/lib/idea.jar
CLASSPATH=$CLASSPATH:$IDEA_HOME/lib/openapi.jar
CLASSPATH=$CLASSPATH:$IDEA_HOME/lib/jdom.jar
CLASSPATH=$CLASSPATH:$IDEA_HOME/lib/log4j.jar
CLASSPATH=$CLASSPATH:$IDEA_HOME/lib/extensions.jar
CLASSPATH=$CLASSPATH:$IDEA_JDK/lib/tools.jar
CLASSPATH=$CLASSPATH:$IDEA_CLASSPATH

and having in mind that the java process in now started in $IDEA_HOME then a small modification is needed in log.xml: from <!DOCTYPE log4j:configuration SYSTEM "file:./log4j.dtd"> to <!DOCTYPE log4j:configuration SYSTEM "file:bin/log4j.dtd">

Hope you find it usefull. I will probably suggest it also on the IntelliJ Idea JIRA

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s