CE installer
[idea/community.git] / bin / nix / idea.sh
1 #!/bin/sh
2 #
3 # ------------------------------------------------------
4 #  IntelliJ IDEA Startup Script for Unix
5 # ------------------------------------------------------
6 #
7
8 # ---------------------------------------------------------------------
9 # Before you run IntelliJ IDEA specify the location of the
10 # JDK 1.6 installation directory which will be used for running IDEA
11 # ---------------------------------------------------------------------
12 if [ -z "$IDEA_JDK" ]; then
13   IDEA_JDK=$JDK_HOME
14   if [ -z "$IDEA_JDK" ]; then
15     echo ERROR: cannot start IntelliJ IDEA.
16     echo No JDK found to run IDEA. Please validate either IDEA_JDK or JDK_HOME points to valid JDK installation
17   fi
18 fi
19
20 #--------------------------------------------------------------------------
21 #   Ensure the IDEA_HOME var for this script points to the
22 #   home directory where IntelliJ IDEA is installed on your system.
23
24 IDEA_HOME=`dirname "$0"`/..
25 IDEA_BIN_HOME=`dirname "$0"`
26
27 export JAVA_HOME
28 export IDEA_HOME
29
30 if [ -n "$IDEA_PROPERTIES" ]; then
31   IDEA_PROPERTIES_PROPERTY=-Didea.properties.file=$IDEA_PROPERTIES
32 fi
33
34 if [ -z "$IDEA_MAIN_CLASS_NAME" ]; then
35   IDEA_MAIN_CLASS_NAME="com.intellij.idea.Main"
36 fi
37
38 if [ -z "$IDEA_VM_OPTIONS" ]; then
39   IDEA_VM_OPTIONS="$IDEA_HOME/bin/idea.vmoptions"
40 fi
41
42 REQUIRED_JVM_ARGS="-Xbootclasspath/a:../lib/boot.jar $IDEA_PROPERTIES_PROPERTY $REQUIRED_JVM_ARGS"
43 JVM_ARGS=`tr '\n' ' ' < "$IDEA_VM_OPTIONS"`
44 JVM_ARGS="$JVM_ARGS $REQUIRED_JVM_ARGS"
45
46 CLASSPATH=../lib/bootstrap.jar
47 CLASSPATH=$CLASSPATH:../lib/util.jar
48 CLASSPATH=$CLASSPATH:../lib/jdom.jar
49 CLASSPATH=$CLASSPATH:../lib/log4j.jar
50 CLASSPATH=$CLASSPATH:../lib/extensions.jar
51 CLASSPATH=$CLASSPATH:../lib/trove4j.jar
52 CLASSPATH=$CLASSPATH:$IDEA_JDK/lib/tools.jar
53 CLASSPATH=$CLASSPATH:$IDEA_CLASSPATH
54
55 export CLASSPATH
56
57 LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
58 export LD_LIBRARY_PATH
59
60 cd "$IDEA_BIN_HOME"
61 exec $IDEA_JDK/bin/java $JVM_ARGS $IDEA_MAIN_CLASS_NAME $*