Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/sh
- ### Don't use this on Ubuntu just yet Im wrorking on this currently Oracle new liscence story which has meesed this up
- ## please note ubuntu supposed instructions dont work correctly either as per how they suggest to install oracle time now ## 08:46 am Ive been at for quite some time Im taking a break
- clear
- echo "Script that takes care of java install jdk8u241 "
- echo "For OpenSuse linux leap 15.1 MD Harrington"
- sleep 2s
- clear
- echo "About to decompress install to /usr/lib64/jvm please wait "
- sudo tar -xvf /home/mark/Downloads/jdk-8u241-linux-x64.tar.gz --directory \
- /usr/lib64/jvm
- # Set these variables according to the Java version to be installed:
- JAVA_VERSION=1.8.0 # JAVA_VERSION = 1.8.0
- JAVA_REVISION=${JAVA_VERSION}_241 # JAVA_REVISION = 1.8.0_u241
- ARCHITECTURE=amd64 # ARCHITECTURE = i386 or amd64
- PRIORITY=18060 # PRIORITY = <your priority>
- LIB_FOLDER=/usr/lib64 # LIB_FOLDER = /usr/lib(64)
- # JVM_FOLDER = /usr/lib(64)/jvm/jdk1.8.0_60
- JVM_FOLDER=${LIB_FOLDER}/jvm/jdk${JAVA_REVISION}
- JVM_F=${LIB_FOLDER}/jvm/jdk${JAVA_REVISION}/man/man1
- echo $JVM_FOLDER
- sleep 2s
- clear
- echo "Compressing man pages in jdk1.8.0_u241/man/man1"
- # compress java man pages
- echo "current working directory is $PWD please wait "
- for f in $(ls /usr/lib64/jvm/jdk1.8.0_241/man/man1/)
- do
- echo "Compressing $f"
- file=/usr/lib64/jvm/jdk1.8.0_241/man/man1/${f}
- sudo gzip $(readlink -f $file)
- done;
- sleep 2s
- clear
- echo "Creating Exports folderin $LIB_FOLDER/jvm-export/$JAVA_REVISION please wait "
- sudo mkdir -p ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
- cd ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
- echo "JVM Folder is $JVM_FOLDER"
- echo "Working directory is now $PWM Creating softlinks Please wait "
- sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jaas-${JAVA_REVISION}.jar
- sudo ln -sf jaas-${JAVA_REVISION}.jar jaas-${JAVA_VERSION}.jar
- sudo ln -sf jaas-${JAVA_REVISION}.jar jaas.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/jce.jar jce-${JAVA_REVISION}.jar
- sudo ln -sf jce-${JAVA_REVISION}.jar jce-${JAVA_VERSION}.jar
- sudo ln -sf jce-${JAVA_REVISION}.jar jce.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jdbc-stdext-${JAVA_REVISION}.jar
- sudo ln -sf jdbc-stdext-${JAVA_REVISION}.jar jdbc-stdext-${JAVA_VERSION}.jar
- sudo ln -sf jdbc-stdext-${JAVA_REVISION}.jar jdbc-stdext-3.0.jar
- sudo ln -sf jdbc-stdext-${JAVA_REVISION}.jar jdbc-stdext.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-${JAVA_REVISION}.jar
- sudo ln -sf jndi-${JAVA_REVISION}.jar jndi-${JAVA_VERSION}.jar
- sudo ln -sf jndi-${JAVA_REVISION}.jar jndi.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-cos-${JAVA_REVISION}.jar
- sudo ln -sf jndi-cos-${JAVA_REVISION}.jar jndi-cos-${JAVA_VERSION}.jar
- sudo ln -sf jndi-cos-${JAVA_REVISION}.jar jndi-cos.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-ldap-${JAVA_REVISION}.jar
- sudo ln -sf jndi-ldap-${JAVA_REVISION}.jar jndi-ldap-${JAVA_VERSION}.jar
- sudo ln -sf jndi-ldap-${JAVA_REVISION}.jar jndi-ldap.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-rmi-${JAVA_REVISION}.jar
- sudo ln -sf jndi-rmi-${JAVA_REVISION}.jar jndi-rmi-${JAVA_VERSION}.jar
- sudo ln -sf jndi-rmi-${JAVA_REVISION}.jar jndi-rmi.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/jsse.jar jsse-${JAVA_REVISION}.jar
- sudo ln -sf jsse-${JAVA_REVISION}.jar jsse-${JAVA_VERSION}.jar
- sudo ln -sf jsse-${JAVA_REVISION}.jar jsse.jar
- sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar sasl-${JAVA_REVISION}.jar
- sudo ln -sf sasl-${JAVA_REVISION}.jar sasl-${JAVA_VERSION}.jar
- sudo ln -sf sasl-${JAVA_REVISION}.jar sasl.jar
- echo "LIB Folder is $LIB_FOLDER"
- echo "JVM Folder is $JVM_FOLDER"
- #>>> java <<< Symbolic links to java JRE commands.
- sudo update-alternatives --install /usr/bin/java java ${JVM_FOLDER}/bin/java ${PRIORITY} \
- --slave ${LIB_FOLDER}/jvm/jre jre ${JVM_FOLDER}/jre \
- --slave ${LIB_FOLDER}/jvm-exports/jre jre_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION} \
- --slave /usr/share/man/man1/java.1.gz java.1.gz ${JVM_FOLDER}/man/man1/java.1.gz \
- --slave /usr/bin/keytool keytool ${JVM_FOLDER}/bin/keytool \
- --slave /usr/share/man/man1/keytool.1.gz keytool.1.gz ${JVM_FOLDER}/man/man1/keytool.1.gz \
- --slave /usr/bin/orbd orbd ${JVM_FOLDER}/bin/orbd \
- --slave /usr/share/man/man1/orbd.1.gz orbd.1.gz ${JVM_FOLDER}/man/man1/orbd.1.gz \
- --slave /usr/bin/policytool policytool ${JVM_FOLDER}/bin/policytool \
- --slave /usr/share/man/man1/policytool.1.gz policytool.1.gz ${JVM_FOLDER}/man/man1/policytool.1.gz \
- --slave /usr/bin/rmid rmid ${JVM_FOLDER}/bin/rmid \
- --slave /usr/share/man/man1/rmid.1.gz rmid.1.gz ${JVM_FOLDER}/man/man1/rmid.1.gz \
- --slave /usr/bin/rmiregistry rmiregistry ${JVM_FOLDER}/bin/rmiregistry \
- --slave /usr/share/man/man1/rmiregistry.1.gz rmiregistry.1.gz ${JVM_FOLDER}/man/man1/rmiregistry.1.gz \
- --slave /usr/bin/servertool servertool ${JVM_FOLDER}/bin/servertool \
- --slave /usr/share/man/man1/servertool.1.gz servertool.1.gz ${JVM_FOLDER}/man/man1/servertool.1.gz \
- --slave /usr/bin/tnameserv tnameserv ${JVM_FOLDER}/bin/tnameserv \
- --slave /usr/share/man/man1/tnameserv.1.gz tnameserv.1.gz ${JVM_FOLDER}/man/man1/tnameserv.1.gz
- sudo update-alternatives --install /usr/bin/javac javac ${JVM_FOLDER}/bin/javac ${PRIORITY} \
- --slave ${LIB_FOLDER}/jvm/java java_sdk ${JVM_FOLDER} \
- --slave ${LIB_FOLDER}/jvm-exports/java java_sdk_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION} \
- --slave /usr/share/man/man1/javac.1.gz javac.1.gz ${JVM_FOLDER}/man/man1/javac.1.gz \
- --slave /usr/bin/appletviewer appletviewer ${JVM_FOLDER}/bin/appletviewer \
- --slave /usr/share/man/man1/appletviewer.1.gz appletviewer.1.gz ${JVM_FOLDER}/man/man1/appletviewer.1.gz \
- --slave /usr/bin/extcheck extcheck ${JVM_FOLDER}/bin/extcheck \
- --slave /usr/share/man/man1/extcheck.1.gz extcheck.1.gz ${JVM_FOLDER}/man/man1/extcheck.1.gz \
- --slave /usr/bin/jar jar ${JVM_FOLDER}/bin/jar \
- --slave /usr/share/man/man1/jar.1.gz jar.1.gz ${JVM_FOLDER}/man/man1/jar.1.gz \
- --slave /usr/bin/jarsigner jarsigner ${JVM_FOLDER}/bin/jarsigner \
- --slave /usr/share/man/man1/jarsigner.1.gz jarsigner.1.gz ${JVM_FOLDER}/man/man1/jarsigner.1.gz \
- --slave /usr/bin/javadoc javadoc ${JVM_FOLDER}/bin/javadoc \
- --slave /usr/share/man/man1/javadoc.1.gz javadoc.1.gz ${JVM_FOLDER}/man/man1/javadoc.1.gz \
- --slave /usr/bin/javah javah ${JVM_FOLDER}/bin/javah \
- --slave /usr/share/man/man1/javah.1.gz javah.1.gz ${JVM_FOLDER}/man/man1/javah.1.gz \
- --slave /usr/bin/javap javap ${JVM_FOLDER}/bin/javap \
- --slave /usr/share/man/man1/javap.1.gz javap.1.gz ${JVM_FOLDER}/man/man1/javap.1.gz \
- --slave /usr/bin/jcmd jcmd ${JVM_FOLDER}/bin/jcmd \
- --slave /usr/share/man/man1/jcmd.1.gz jcmd.1.gz ${JVM_FOLDER}/man/man1/jcmd.1.gz \
- --slave /usr/bin/jconsole jconsole ${JVM_FOLDER}/bin/jconsole \
- --slave /usr/share/man/man1/jconsole.1.gz jconsole.1.gz ${JVM_FOLDER}/man/man1/jconsole.1.gz \
- --slave /usr/bin/jdb jdb ${JVM_FOLDER}/bin/jdb \
- --slave /usr/share/man/man1/jdb.1.gz jdb.1.gz ${JVM_FOLDER}/man/man1/jdb.1.gz \
- --slave /usr/bin/jhat jhat ${JVM_FOLDER}/bin/jhat \
- --slave /usr/share/man/man1/jhat.1.gz jhat.1.gz ${JVM_FOLDER}/man/man1/jhat.1.gz \
- --slave /usr/bin/jinfo jinfo ${JVM_FOLDER}/bin/jinfo \
- --slave /usr/share/man/man1/jinfo.1.gz jinfo.1.gz ${JVM_FOLDER}/man/man1/jinfo.1.gz \
- --slave /usr/bin/jmap jmap ${JVM_FOLDER}/bin/jmap \
- --slave /usr/share/man/man1/jmap.1.gz jmap.1.gz ${JVM_FOLDER}/man/man1/jmap.1.gz \
- --slave /usr/bin/jps jps ${JVM_FOLDER}/bin/jps \
- --slave /usr/share/man/man1/jps.1.gz jps.1.gz ${JVM_FOLDER}/man/man1/jps.1.gz \
- --slave /usr/bin/jrunscript jrunscript ${JVM_FOLDER}/bin/jrunscript \
- --slave /usr/share/man/man1/jrunscript.1.gz jrunscript.1.gz ${JVM_FOLDER}/man/man1/jrunscript.1.gz \
- --slave /usr/bin/jsadebugd jsadebugd ${JVM_FOLDER}/bin/jsadebugd \
- --slave /usr/share/man/man1/jsadebugd.1.gz jsadebugd.1.gz ${JVM_FOLDER}/man/man1/jsadebugd.1.gz \
- --slave /usr/bin/jstack jstack ${JVM_FOLDER}/bin/jstack \
- --slave /usr/share/man/man1/jstack.1.gz jstack.1.gz ${JVM_FOLDER}/man/man1/jstack.1.gz \
- --slave /usr/bin/jstat jstat ${JVM_FOLDER}/bin/jstat \
- --slave /usr/share/man/man1/jstat.1.gz jstat.1.gz ${JVM_FOLDER}/man/man1/jstat.1.gz \
- --slave /usr/bin/jstatd jstatd ${JVM_FOLDER}/bin/jstatd \
- --slave /usr/share/man/man1/jstatd.1.gz jstatd.1.gz ${JVM_FOLDER}/man/man1/jstatd.1.gz \
- --slave /usr/bin/native2ascii native2ascii ${JVM_FOLDER}/bin/native2ascii \
- --slave /usr/share/man/man1/native2ascii.1.gz native2ascii.1.gz ${JVM_FOLDER}/man/man1/native2ascii.1.gz \
- --slave /usr/bin/pack200 pack200 ${JVM_FOLDER}/bin/pack200 \
- --slave /usr/share/man/man1/pack200.1.gz pack200.1.gz ${JVM_FOLDER}/man/man1/pack200.1.gz \
- --slave /usr/bin/rmic rmic ${JVM_FOLDER}/bin/rmic \
- --slave /usr/share/man/man1/rmic.1.gz rmic.1.gz ${JVM_FOLDER}/man/man1/rmic.1.gz \
- --slave /usr/bin/schemagen schemagen ${JVM_FOLDER}/bin/schemagen \
- --slave /usr/share/man/man1/schemagen.1.gz schemagen.1.gz ${JVM_FOLDER}/man/man1/schemagen.1.gz \
- --slave /usr/bin/serialver serialver ${JVM_FOLDER}/bin/serialver \
- --slave /usr/share/man/man1/serialver.1.gz serialver.1.gz ${JVM_FOLDER}/man/man1/serialver.1.gz \
- --slave /usr/bin/unpack200 unpack200 ${JVM_FOLDER}/bin/unpack200 \
- --slave /usr/share/man/man1/unpack200.1.gz unpack200.1.gz ${JVM_FOLDER}/man/man1/unpack200.1.gz \
- --slave /usr/bin/wsgen wsgen ${JVM_FOLDER}/bin/wsgen \
- --slave /usr/share/man/man1/wsgen.1.gz wsgen.1.gz ${JVM_FOLDER}/man/man1/wsgen.1.gz \
- --slave /usr/bin/wsimport wsimport ${JVM_FOLDER}/bin/wsimport \
- --slave /usr/share/man/man1/wsimport.1.gz wsimport.1.gz ${JVM_FOLDER}/man/man1/wsimport.1.gz \
- --slave /usr/bin/xjc xjc ${JVM_FOLDER}/bin/xjc \
- --slave /usr/share/man/man1/xjc.1.gz xjc.1.gz ${JVM_FOLDER}/man/man1/xjc.1.gz
- # >>> javaplugin <<< Symbolic links to Web browser plugin commands.
- sudo update-alternatives --install ${LIB_FOLDER}/browser-plugins/javaplugin.so javaplugin ${JVM_FOLDER}/jre/lib/${ARCHITECTURE}/libnpjp2.so ${PRIORITY} \
- --slave /usr/bin/javaws javaws ${JVM_FOLDER}/jre/bin/javaws \
- --slave /usr/share/man/man1/javaws.1 javaws.1 ${JVM_FOLDER}/man/man1/javaws.1.gz
- # >>> java_jre_1.8.0 <<< Symbolic links to java 1.8.0 JRE commands.
- sudo update-alternatives --install ${LIB_FOLDER}/jvm/jre-${JAVA_VERSION} jre_${JAVA_VERSION} ${JVM_FOLDER}/jre ${PRIORITY} \
- --slave ${LIB_FOLDER}/jvm-exports/jre-${JAVA_VERSION} jre_${JAVA_VERSION}_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
- # >>> java_sdk_1.8.0 <<< Symbolic links to java 1.8.0 JDK commands.
- sudo update-alternatives --install ${LIB_FOLDER}/jvm/java-${JAVA_VERSION} java_sdk_${JAVA_VERSION} ${JVM_FOLDER} ${PRIORITY} \
- --slave ${LIB_FOLDER}/jvm-exports/java-${JAVA_VERSION} java_sdk_${JAVA_VERSION}_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
- # >>> javadocdir <<< Symbolic links to java API documentation.
- sudo update-alternatives --install /usr/share/javadoc/java javadocdir /usr/share/javadoc/jdk${JAVA_REVISION}/api ${PRIORITY}
- # Expose Sun's Java control panel and various icons.
- sudo ln -s ${JVM_FOLDER}/jre/bin/jcontrol /usr/bin/
- sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/hicolor/16x16/apps/sun-jcontrol.png /usr/share/icons/hicolor/16x16/apps/
- sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png /usr/share/icons/hicolor/48x48/apps/
- sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/LowContrast/16x16/apps/sun-jcontrol.png /usr/share/icons/locolor/16x16/apps/
- sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/LowContrast/48x48/apps/sun-jcontrol.png /usr/share/icons/locolor/48x48/apps/
- sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/applications/sun_java.desktop /usr/share/applications
- exit -1
Add Comment
Please, Sign In to add comment