Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update system java to jdk8
#!/bin/bash
## JDK=$(cd /usr/java/jdk1.8* && pwd)
JDK=/usr/java/latest
update-alternatives \
--install /usr/bin/java java $JDK/jre/bin/java 18000 \
--slave /usr/lib/jvm/jre jre $JDK/jre \
--slave /usr/bin/javac javac $JDK/bin/javac \
--slave /usr/bin/javah javah $JDK/bin/javah \
--slave /usr/bin/javap javap $JDK/bin/javap \
--slave /usr/bin/jar jar $JDK/bin/jar \
--slave /usr/bin/jarsigner jarsigner $JDK/bin/jarsigner \
--slave /usr/bin/jmap jmap $JDK/bin/jmap \
--slave /usr/bin/keytool keytool $JDK/bin/keytool \
--slave /usr/bin/javadoc javadoc $JDK/bin/javadoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment