Commit ff7c6002 authored by Kannan Goundan's avatar Kannan Goundan Committed by Jacob Potter

src/support/sbt: Don't pass -XX:MaxPermSize to JDK 1.8+

That option is deprecated in JDK 1.8 and causes a warning message.

Closes #75
parent f09e0bf5
...@@ -14,8 +14,22 @@ while [ -h "$loc" ]; do ...@@ -14,8 +14,22 @@ while [ -h "$loc" ]; do
done done
base_dir=$(cd `dirname "$loc"` && pwd) base_dir=$(cd `dirname "$loc"` && pwd)
# Just the first two digits of the version.
java_version=$(java -version 2>&1 | sed -ne '1s/.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*/\1/p')
if [[ "$java_version" == 1.[0-5] ]]; then
echo "Executing \"java -version\" reports \"$java_version\"." 1>&2
echo "We require at least Java 1.6." 1>&2
exit 1
fi
jvm_args=()
if [[ "$java_version" == 1.[6-7] ]]; then
jvm_args+=(-XX:MaxPermSize=256M) # Not relevant to JDK 1.8+
fi
java \ java \
-Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M \ -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled "${jvm_args[@]}" \
-Djava.security.manager -Djava.security.policy="$base_dir/sbt.security.policy" \ -Djava.security.manager -Djava.security.policy="$base_dir/sbt.security.policy" \
-jar "$base_dir/sbt-launch.jar" \ -jar "$base_dir/sbt-launch.jar" \
-Dsbt.override.build.repos=true \ -Dsbt.override.build.repos=true \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment