Skip to content

Instantly share code, notes, and snippets.

@develar
Created June 26, 2012 10:31
Show Gist options
  • Save develar/2994911 to your computer and use it in GitHub Desktop.
Save develar/2994911 to your computer and use it in GitHub Desktop.
idea launcher for java 8
#!/bin/sh
JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
BITS="64"
MAIN_CLASS_NAME="com.intellij.idea.Main"
IS_EAP="false"
if [ "$IS_EAP" = "true" ]; then
OS_NAME=`echo $OS_TYPE | tr '[:upper:]' '[:lower:]'`
AGENT_LIB="yjpagent-$OS_NAME$BITS"
if [ -r "$IDE_BIN_HOME/lib$AGENT_LIB.so" ]; then
AGENT="-agentlib:$AGENT_LIB=disablej2ee,disablecounts,disablealloc,sessionname=IdeaIC11"
fi
fi
SCRIPT_LOCATION=$0
while [ -L "$SCRIPT_LOCATION" ]; do
SCRIPT_LOCATION=`readlink -e "$SCRIPT_LOCATION"`
done
APP_PACKAGE=`dirname "$SCRIPT_LOCATION"`/..
COMMON_JVM_ARGS="-ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar -Xms128m -Xmx1024m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=64m -XX:+UseCompressedOops -Didea.paths.selector=IntelliJIdea11 -Didea.popup.weight=heavy -Didea.dynamic.classpath=false -Dswing.bufferPerWindow=false -Didea.smooth.progress=false -DCVS_PASSFILE=~/.cvspass -Didea.max.intellisense.filesize=2500 -Didea.xdebug.key=-Xdebug -Dapple.awt.fullscreencapturealldisplays=false -Didea.cycle.buffer.size=1024 -Dcom.apple.mrj.application.live-resize=false -Djava.endorsed.dirs -Dsun.java2d.noddraw=true -Didea.jars.nocopy=false -Dsun.java2d.pmoffscreen=false -Didea.use.default.antialiasing.in.editor=false -Didea.fatal.error.notification=enabled -Dapple.awt.graphics.UseQuartz=true -Didea.no.launcher=false -Dsun.java2d.d3d=false -Dapple.laf.useScreenMenuBar=true -Xdock:icon=$APP_PACKAGE/Contents/Resources/idea.icns"
ALL_JVM_ARGS="$COMMON_JVM_ARGS $AGENT"
CLASSPATH="$APP_PACKAGE/lib/bootstrap.jar:$APP_PACKAGE/lib/extensions.jar:$APP_PACKAGE/lib/util.jar:$APP_PACKAGE/lib/jdom.jar:$APP_PACKAGE/lib/log4j.jar:$APP_PACKAGE/lib/trove4j.jar:$APP_PACKAGE/lib/jna.jar:$JDK/lib/tools.jar"
export CLASSPATH
# ---------------------------------------------------------------------
# Run the IDE.
# ---------------------------------------------------------------------
cd "$IDE_BIN_HOME"
while true ; do
eval $JDK/bin/java $ALL_JVM_ARGS -Djb.restart.code=88 $MAIN_CLASS_NAME $*
test $? -ne 88 && break
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment