File intellij-idea-idea of Package intellij-idea

#!/bin/sh
# 
# Startup script for IntelliJ IDEA
# Lubomir Rintel <lkundrak@v3.sk>

set -e

# Source functions library
if [ -f /usr/share/java-utils/java-functions ] ; then 
	. /usr/share/java-utils/java-functions
else
	echo "Can't find functions library, aborting"
	exit 1
fi

# Default configuration
BASE_FLAGS="-Xms32m -Xmx256m -XX:MaxPermSize=150m -ea"
MAIN_CLASS=com.intellij.idea.Main

IDEA_HOME=/usr/lib/idea/
[ "$(getconf ULONG_MAX)" = 18446744073709551615 ] &&
	IDEA_HOME=/usr/lib64/idea/

# Override with system-wide configuration
[ -f /etc/idea.conf ] && . /etc/idea.conf

# Override with user configuration
[ -f "$HOME/.idearc" ] && . "$HOME/.idearc"

# IntelliJ itself
BASE_JARS="$BASE_JARS idea/extensions"
BASE_JARS="$BASE_JARS idea/util"
BASE_JARS="$BASE_JARS idea/icons"
BASE_JARS="$BASE_JARS idea/idea_rt"
BASE_JARS="$BASE_JARS idea/annotations"
BASE_JARS="$BASE_JARS idea/resources"
BASE_JARS="$BASE_JARS idea/trove4j"
BASE_JARS="$BASE_JARS idea/idea"
BASE_JARS="$BASE_JARS idea/javac2"
BASE_JARS="$BASE_JARS idea/bootstrap"
BASE_JARS="$BASE_JARS idea/resources_en"
BASE_JARS="$BASE_JARS idea/openapi"
BASE_JARS="$BASE_JARS idea/boot"
BASE_JARS="$BASE_JARS idea/forms_rt"

# Fedora x openSUSE differencies
FORMS=jgoodies-forms;	build-classpath $FORMS >/dev/null 2>&1 || FORMS=forms
LOOKS=jgoodies-looks;	build-classpath $LOOKS >/dev/null 2>&1 || LOOKS=looks
XMLRPC=xmlrpc;		build-classpath $XMLRPC >/dev/null 2>&1 || XMLRPC=xmlrpc2
JDT_CORE=$(for F in /usr/{lib/eclipse/dropins/jdt,share/eclipse}/plugins/org.eclipse.jdt.core_*.jar
	do [ -f $F ] && break; done;
	echo $F |sed 's,\(.*\)\.jar$,../../..\1,')

# Dependencies
BASE_JARS="$BASE_JARS ant/ant-apache-oro"
BASE_JARS="$BASE_JARS ant/ant-nodeps"
BASE_JARS="$BASE_JARS cglib-2.2"
BASE_JARS="$BASE_JARS commons-codec-1.3"
BASE_JARS="$BASE_JARS commons-collections"
BASE_JARS="$BASE_JARS commons-lang-2.3"
BASE_JARS="$BASE_JARS jakarta-commons-net-2.0"
BASE_JARS="$BASE_JARS javahelp2"
BASE_JARS="$BASE_JARS jaxen-1.1.1"
BASE_JARS="$BASE_JARS jdom"
BASE_JARS="$BASE_JARS $FORMS"
BASE_JARS="$BASE_JARS $LOOKS"
BASE_JARS="$BASE_JARS jna"
BASE_JARS="$BASE_JARS jna-examples"
BASE_JARS="$BASE_JARS junit"
BASE_JARS="$BASE_JARS junit4-4.6"
BASE_JARS="$BASE_JARS ../jvm/java/lib/tools"
BASE_JARS="$BASE_JARS log4j"
BASE_JARS="$BASE_JARS microba"
BASE_JARS="$BASE_JARS nanoxml"
BASE_JARS="$BASE_JARS nanoxml-2.2.3"
BASE_JARS="$BASE_JARS objectweb-asm/asm"
BASE_JARS="$BASE_JARS objectweb-asm/asm-commons"
BASE_JARS="$BASE_JARS oro"
BASE_JARS="$BASE_JARS picocontainer"
BASE_JARS="$BASE_JARS velocity"
BASE_JARS="$BASE_JARS xerces-j2"
BASE_JARS="$BASE_JARS xmlbeans/xbean"
BASE_JARS="$BASE_JARS xml-commons-resolver"
BASE_JARS="$BASE_JARS $XMLRPC"
BASE_JARS="$BASE_JARS xstream"
BASE_JARS="$BASE_JARS groovy"
BASE_JARS="$BASE_JARS $JDT_CORE"

# Bootstrap
BASE_FLAGS="$BASE_FLAGS -Xbootclasspath/a:$(/usr/bin/build-classpath idea/boot)"

# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS $IDEA_OPTS -Didea.home.path="$IDEA_HOME" -Didea.log.path="$HOME/.idea/log" \
	-Didea.config.path="$HOME/.idea/config" -Didea.system.path="$HOME/.idea/system"

# Let's start
cd $IDEA_HOME
run "$@"
openSUSE Build Service is sponsored by