Mark2020H

Modified Scripts to install and set up JavaOracle JDK1.8.0

Feb 5th, 2020
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 11.56 KB | None | 0 0
  1. #!/usr/bin/sh
  2.  
  3. ###  Don't use this on Ubuntu just yet  Im wrorking on this currently Oracle  new liscence story which has meesed this up  
  4. ## 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
  5.  
  6.  
  7. clear
  8. echo "Script that takes care of  java install jdk8u241 "
  9. echo "For OpenSuse linux leap 15.1 MD Harrington"
  10.  
  11. sleep 2s
  12. clear
  13.  
  14. echo "About to decompress  install to  /usr/lib64/jvm  please wait  "
  15.  
  16. sudo tar -xvf /home/mark/Downloads/jdk-8u241-linux-x64.tar.gz --directory \
  17. /usr/lib64/jvm
  18.  
  19.  
  20.  
  21. # Set these variables according to the Java version to be installed:
  22. JAVA_VERSION=1.8.0                   # JAVA_VERSION  = 1.8.0
  23. JAVA_REVISION=${JAVA_VERSION}_241  # JAVA_REVISION = 1.8.0_u241
  24. ARCHITECTURE=amd64                 # ARCHITECTURE  = i386 or amd64
  25. PRIORITY=18060                     # PRIORITY      = <your priority>
  26. LIB_FOLDER=/usr/lib64              # LIB_FOLDER    = /usr/lib(64)
  27.  
  28. # JVM_FOLDER    = /usr/lib(64)/jvm/jdk1.8.0_60
  29. JVM_FOLDER=${LIB_FOLDER}/jvm/jdk${JAVA_REVISION}
  30. JVM_F=${LIB_FOLDER}/jvm/jdk${JAVA_REVISION}/man/man1
  31.  
  32. echo $JVM_FOLDER
  33.  
  34. sleep 2s
  35. clear
  36. echo "Compressing man pages in jdk1.8.0_u241/man/man1"
  37. # compress java man pages
  38.  
  39. echo "current working  directory is $PWD please wait "
  40.  
  41. for f in $(ls /usr/lib64/jvm/jdk1.8.0_241/man/man1/)
  42. do
  43.   echo "Compressing $f"
  44.   file=/usr/lib64/jvm/jdk1.8.0_241/man/man1/${f}
  45.   sudo gzip $(readlink -f $file)
  46. done;
  47.  
  48.  
  49. sleep 2s
  50. clear
  51.  
  52. echo "Creating Exports folderin $LIB_FOLDER/jvm-export/$JAVA_REVISION please wait "
  53.  
  54.  
  55.  
  56. sudo mkdir -p ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
  57. cd ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
  58.  
  59. echo "JVM Folder is $JVM_FOLDER"
  60.  
  61. echo "Working directory is now $PWM Creating softlinks  Please wait "
  62.  
  63. sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jaas-${JAVA_REVISION}.jar
  64. sudo ln -sf jaas-${JAVA_REVISION}.jar jaas-${JAVA_VERSION}.jar
  65. sudo ln -sf jaas-${JAVA_REVISION}.jar jaas.jar
  66. sudo ln -sf ${JVM_FOLDER}/jre/lib/jce.jar jce-${JAVA_REVISION}.jar
  67. sudo ln -sf jce-${JAVA_REVISION}.jar jce-${JAVA_VERSION}.jar
  68. sudo ln -sf jce-${JAVA_REVISION}.jar jce.jar
  69. sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jdbc-stdext-${JAVA_REVISION}.jar
  70. sudo ln -sf jdbc-stdext-${JAVA_REVISION}.jar jdbc-stdext-${JAVA_VERSION}.jar
  71. sudo ln -sf jdbc-stdext-${JAVA_REVISION}.jar jdbc-stdext-3.0.jar
  72. sudo ln -sf jdbc-stdext-${JAVA_REVISION}.jar jdbc-stdext.jar
  73. sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-${JAVA_REVISION}.jar
  74. sudo ln -sf jndi-${JAVA_REVISION}.jar jndi-${JAVA_VERSION}.jar
  75. sudo ln -sf jndi-${JAVA_REVISION}.jar jndi.jar
  76. sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-cos-${JAVA_REVISION}.jar
  77. sudo ln -sf jndi-cos-${JAVA_REVISION}.jar jndi-cos-${JAVA_VERSION}.jar
  78. sudo ln -sf jndi-cos-${JAVA_REVISION}.jar jndi-cos.jar
  79. sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-ldap-${JAVA_REVISION}.jar
  80. sudo ln -sf jndi-ldap-${JAVA_REVISION}.jar jndi-ldap-${JAVA_VERSION}.jar
  81. sudo ln -sf jndi-ldap-${JAVA_REVISION}.jar jndi-ldap.jar
  82. sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar jndi-rmi-${JAVA_REVISION}.jar
  83. sudo ln -sf jndi-rmi-${JAVA_REVISION}.jar jndi-rmi-${JAVA_VERSION}.jar
  84. sudo ln -sf jndi-rmi-${JAVA_REVISION}.jar jndi-rmi.jar
  85. sudo ln -sf ${JVM_FOLDER}/jre/lib/jsse.jar jsse-${JAVA_REVISION}.jar
  86. sudo ln -sf jsse-${JAVA_REVISION}.jar jsse-${JAVA_VERSION}.jar
  87. sudo ln -sf jsse-${JAVA_REVISION}.jar jsse.jar
  88. sudo ln -sf ${JVM_FOLDER}/jre/lib/rt.jar sasl-${JAVA_REVISION}.jar
  89. sudo ln -sf sasl-${JAVA_REVISION}.jar sasl-${JAVA_VERSION}.jar
  90. sudo ln -sf sasl-${JAVA_REVISION}.jar sasl.jar
  91.  
  92.  
  93. echo "LIB Folder is $LIB_FOLDER"
  94. echo "JVM Folder is $JVM_FOLDER"
  95.  
  96. #>>> java <<< Symbolic links to java JRE commands.
  97.  
  98.  sudo update-alternatives --install /usr/bin/java java ${JVM_FOLDER}/bin/java ${PRIORITY} \
  99.  --slave ${LIB_FOLDER}/jvm/jre jre ${JVM_FOLDER}/jre \
  100.  --slave ${LIB_FOLDER}/jvm-exports/jre jre_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION} \
  101.  --slave /usr/share/man/man1/java.1.gz java.1.gz ${JVM_FOLDER}/man/man1/java.1.gz \
  102.  --slave /usr/bin/keytool keytool ${JVM_FOLDER}/bin/keytool \
  103.  --slave /usr/share/man/man1/keytool.1.gz keytool.1.gz ${JVM_FOLDER}/man/man1/keytool.1.gz \
  104.  --slave /usr/bin/orbd orbd ${JVM_FOLDER}/bin/orbd \
  105.  --slave /usr/share/man/man1/orbd.1.gz orbd.1.gz ${JVM_FOLDER}/man/man1/orbd.1.gz \
  106.  --slave /usr/bin/policytool policytool ${JVM_FOLDER}/bin/policytool \
  107.  --slave /usr/share/man/man1/policytool.1.gz policytool.1.gz ${JVM_FOLDER}/man/man1/policytool.1.gz \
  108.  --slave /usr/bin/rmid rmid ${JVM_FOLDER}/bin/rmid \
  109.  --slave /usr/share/man/man1/rmid.1.gz rmid.1.gz ${JVM_FOLDER}/man/man1/rmid.1.gz \
  110.  --slave /usr/bin/rmiregistry rmiregistry ${JVM_FOLDER}/bin/rmiregistry \
  111.  --slave /usr/share/man/man1/rmiregistry.1.gz rmiregistry.1.gz ${JVM_FOLDER}/man/man1/rmiregistry.1.gz \
  112.  --slave /usr/bin/servertool servertool ${JVM_FOLDER}/bin/servertool \
  113.  --slave /usr/share/man/man1/servertool.1.gz servertool.1.gz ${JVM_FOLDER}/man/man1/servertool.1.gz \
  114.  --slave /usr/bin/tnameserv tnameserv ${JVM_FOLDER}/bin/tnameserv \
  115.  --slave /usr/share/man/man1/tnameserv.1.gz tnameserv.1.gz ${JVM_FOLDER}/man/man1/tnameserv.1.gz
  116.  
  117.  
  118. sudo update-alternatives --install /usr/bin/javac javac ${JVM_FOLDER}/bin/javac ${PRIORITY} \
  119. --slave ${LIB_FOLDER}/jvm/java java_sdk ${JVM_FOLDER} \
  120. --slave ${LIB_FOLDER}/jvm-exports/java java_sdk_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION} \
  121. --slave /usr/share/man/man1/javac.1.gz javac.1.gz ${JVM_FOLDER}/man/man1/javac.1.gz \
  122. --slave /usr/bin/appletviewer appletviewer ${JVM_FOLDER}/bin/appletviewer \
  123. --slave /usr/share/man/man1/appletviewer.1.gz appletviewer.1.gz ${JVM_FOLDER}/man/man1/appletviewer.1.gz \
  124. --slave /usr/bin/extcheck extcheck ${JVM_FOLDER}/bin/extcheck \
  125. --slave /usr/share/man/man1/extcheck.1.gz extcheck.1.gz ${JVM_FOLDER}/man/man1/extcheck.1.gz \
  126. --slave /usr/bin/jar jar ${JVM_FOLDER}/bin/jar \
  127. --slave /usr/share/man/man1/jar.1.gz jar.1.gz ${JVM_FOLDER}/man/man1/jar.1.gz \
  128. --slave /usr/bin/jarsigner jarsigner ${JVM_FOLDER}/bin/jarsigner \
  129. --slave /usr/share/man/man1/jarsigner.1.gz jarsigner.1.gz ${JVM_FOLDER}/man/man1/jarsigner.1.gz \
  130. --slave /usr/bin/javadoc javadoc ${JVM_FOLDER}/bin/javadoc \
  131. --slave /usr/share/man/man1/javadoc.1.gz javadoc.1.gz ${JVM_FOLDER}/man/man1/javadoc.1.gz \
  132. --slave /usr/bin/javah javah ${JVM_FOLDER}/bin/javah \
  133. --slave /usr/share/man/man1/javah.1.gz javah.1.gz ${JVM_FOLDER}/man/man1/javah.1.gz \
  134. --slave /usr/bin/javap javap ${JVM_FOLDER}/bin/javap \
  135. --slave /usr/share/man/man1/javap.1.gz javap.1.gz ${JVM_FOLDER}/man/man1/javap.1.gz \
  136. --slave /usr/bin/jcmd jcmd ${JVM_FOLDER}/bin/jcmd \
  137. --slave /usr/share/man/man1/jcmd.1.gz jcmd.1.gz ${JVM_FOLDER}/man/man1/jcmd.1.gz \
  138. --slave /usr/bin/jconsole jconsole ${JVM_FOLDER}/bin/jconsole \
  139. --slave /usr/share/man/man1/jconsole.1.gz jconsole.1.gz ${JVM_FOLDER}/man/man1/jconsole.1.gz \
  140. --slave /usr/bin/jdb jdb ${JVM_FOLDER}/bin/jdb \
  141. --slave /usr/share/man/man1/jdb.1.gz jdb.1.gz ${JVM_FOLDER}/man/man1/jdb.1.gz \
  142. --slave /usr/bin/jhat jhat ${JVM_FOLDER}/bin/jhat \
  143. --slave /usr/share/man/man1/jhat.1.gz jhat.1.gz ${JVM_FOLDER}/man/man1/jhat.1.gz \
  144. --slave /usr/bin/jinfo jinfo ${JVM_FOLDER}/bin/jinfo \
  145. --slave /usr/share/man/man1/jinfo.1.gz jinfo.1.gz ${JVM_FOLDER}/man/man1/jinfo.1.gz \
  146. --slave /usr/bin/jmap jmap ${JVM_FOLDER}/bin/jmap \
  147. --slave /usr/share/man/man1/jmap.1.gz jmap.1.gz ${JVM_FOLDER}/man/man1/jmap.1.gz \
  148. --slave /usr/bin/jps jps ${JVM_FOLDER}/bin/jps \
  149. --slave /usr/share/man/man1/jps.1.gz jps.1.gz ${JVM_FOLDER}/man/man1/jps.1.gz \
  150. --slave /usr/bin/jrunscript jrunscript ${JVM_FOLDER}/bin/jrunscript \
  151. --slave /usr/share/man/man1/jrunscript.1.gz jrunscript.1.gz ${JVM_FOLDER}/man/man1/jrunscript.1.gz \
  152. --slave /usr/bin/jsadebugd jsadebugd ${JVM_FOLDER}/bin/jsadebugd \
  153. --slave /usr/share/man/man1/jsadebugd.1.gz jsadebugd.1.gz ${JVM_FOLDER}/man/man1/jsadebugd.1.gz \
  154. --slave /usr/bin/jstack jstack ${JVM_FOLDER}/bin/jstack \
  155. --slave /usr/share/man/man1/jstack.1.gz jstack.1.gz ${JVM_FOLDER}/man/man1/jstack.1.gz \
  156. --slave /usr/bin/jstat jstat ${JVM_FOLDER}/bin/jstat \
  157. --slave /usr/share/man/man1/jstat.1.gz jstat.1.gz ${JVM_FOLDER}/man/man1/jstat.1.gz \
  158. --slave /usr/bin/jstatd jstatd ${JVM_FOLDER}/bin/jstatd \
  159. --slave /usr/share/man/man1/jstatd.1.gz jstatd.1.gz ${JVM_FOLDER}/man/man1/jstatd.1.gz \
  160. --slave /usr/bin/native2ascii native2ascii ${JVM_FOLDER}/bin/native2ascii \
  161. --slave /usr/share/man/man1/native2ascii.1.gz native2ascii.1.gz ${JVM_FOLDER}/man/man1/native2ascii.1.gz \
  162. --slave /usr/bin/pack200 pack200 ${JVM_FOLDER}/bin/pack200 \
  163. --slave /usr/share/man/man1/pack200.1.gz pack200.1.gz ${JVM_FOLDER}/man/man1/pack200.1.gz \
  164. --slave /usr/bin/rmic rmic ${JVM_FOLDER}/bin/rmic \
  165. --slave /usr/share/man/man1/rmic.1.gz rmic.1.gz ${JVM_FOLDER}/man/man1/rmic.1.gz \
  166. --slave /usr/bin/schemagen schemagen ${JVM_FOLDER}/bin/schemagen \
  167. --slave /usr/share/man/man1/schemagen.1.gz schemagen.1.gz ${JVM_FOLDER}/man/man1/schemagen.1.gz \
  168. --slave /usr/bin/serialver serialver ${JVM_FOLDER}/bin/serialver \
  169. --slave /usr/share/man/man1/serialver.1.gz serialver.1.gz ${JVM_FOLDER}/man/man1/serialver.1.gz \
  170. --slave /usr/bin/unpack200 unpack200 ${JVM_FOLDER}/bin/unpack200 \
  171. --slave /usr/share/man/man1/unpack200.1.gz unpack200.1.gz ${JVM_FOLDER}/man/man1/unpack200.1.gz \
  172. --slave /usr/bin/wsgen wsgen ${JVM_FOLDER}/bin/wsgen \
  173. --slave /usr/share/man/man1/wsgen.1.gz wsgen.1.gz ${JVM_FOLDER}/man/man1/wsgen.1.gz \
  174. --slave /usr/bin/wsimport wsimport ${JVM_FOLDER}/bin/wsimport \
  175. --slave /usr/share/man/man1/wsimport.1.gz wsimport.1.gz ${JVM_FOLDER}/man/man1/wsimport.1.gz \
  176. --slave /usr/bin/xjc xjc ${JVM_FOLDER}/bin/xjc \
  177. --slave /usr/share/man/man1/xjc.1.gz xjc.1.gz ${JVM_FOLDER}/man/man1/xjc.1.gz
  178.  
  179. # >>> javaplugin <<< Symbolic links to Web browser plugin commands.
  180. sudo update-alternatives --install ${LIB_FOLDER}/browser-plugins/javaplugin.so javaplugin ${JVM_FOLDER}/jre/lib/${ARCHITECTURE}/libnpjp2.so ${PRIORITY} \
  181. --slave /usr/bin/javaws javaws ${JVM_FOLDER}/jre/bin/javaws \
  182. --slave /usr/share/man/man1/javaws.1 javaws.1 ${JVM_FOLDER}/man/man1/javaws.1.gz
  183.  
  184.  
  185. # >>> java_jre_1.8.0 <<< Symbolic links to java 1.8.0 JRE commands.
  186. sudo update-alternatives --install ${LIB_FOLDER}/jvm/jre-${JAVA_VERSION} jre_${JAVA_VERSION} ${JVM_FOLDER}/jre ${PRIORITY} \
  187. --slave ${LIB_FOLDER}/jvm-exports/jre-${JAVA_VERSION} jre_${JAVA_VERSION}_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
  188.  
  189.  
  190. # >>> java_sdk_1.8.0 <<< Symbolic links to java 1.8.0 JDK commands.
  191. sudo update-alternatives --install ${LIB_FOLDER}/jvm/java-${JAVA_VERSION} java_sdk_${JAVA_VERSION} ${JVM_FOLDER} ${PRIORITY} \
  192. --slave ${LIB_FOLDER}/jvm-exports/java-${JAVA_VERSION} java_sdk_${JAVA_VERSION}_exports ${LIB_FOLDER}/jvm-exports/jdk${JAVA_REVISION}
  193.  
  194.  
  195. # >>> javadocdir <<< Symbolic links to java API documentation.
  196. sudo update-alternatives --install /usr/share/javadoc/java javadocdir /usr/share/javadoc/jdk${JAVA_REVISION}/api ${PRIORITY}
  197.  
  198.  
  199. # Expose Sun's Java control panel and various icons.
  200. sudo ln -s ${JVM_FOLDER}/jre/bin/jcontrol /usr/bin/
  201. sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/hicolor/16x16/apps/sun-jcontrol.png /usr/share/icons/hicolor/16x16/apps/
  202. sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png /usr/share/icons/hicolor/48x48/apps/
  203. sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/LowContrast/16x16/apps/sun-jcontrol.png /usr/share/icons/locolor/16x16/apps/
  204. sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/icons/LowContrast/48x48/apps/sun-jcontrol.png /usr/share/icons/locolor/48x48/apps/
  205. sudo ln -s ${JVM_FOLDER}/jre/lib/desktop/applications/sun_java.desktop /usr/share/applications
  206.  
  207.  
  208. exit -1
Add Comment
Please, Sign In to add comment