From 13cbb1260288871a5cbbf3b98815252f3e9b5aa3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20H=C3=B6xter?= Date: Fri, 9 Mar 2018 19:14:10 +0100 Subject: [PATCH] Basic support for Java 10 Based on release candidates build provided on http://jdk.java.net/10/ It still has some rough edges around plugins and binary lists but basically works. --- lib/oracle-jdk.sh | 24 ++++++++++++++++++++---- lib/oracle-jre.sh | 42 ++++++++++++++++++++++++++++++------------ 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/lib/oracle-jdk.sh b/lib/oracle-jdk.sh index f12d95f..54f3829 100644 --- a/lib/oracle-jdk.sh +++ b/lib/oracle-jdk.sh @@ -3,6 +3,22 @@ j2se_detect_oracle_j2sdk=oracle_j2sdk_detect oracle_j2sdk_detect() { j2se_release=0 + # JDK 10 release candidate (jdk-10+46_linux-x64_bin.tar.gz) + if [[ $archive_name =~ jdk-10(\.([0-9]+)\.([0-9]+)|\+[0-9]+)?_linux-x64_bin\.tar\.gz ]] + then + j2se_release=10 + j2se_update=${BASH_REMATCH[1]:-.0.0} + j2se_arch=x64 + j2se_version_name="${j2se_release} version ${j2se_release}${j2se_update}" + j2se_version=${j2se_release}${j2se_update}${revision} + j2se_expected_min_size=340 #Mb + j2se_binary_subdir="/bin" + oracle_no_man_jre_bin_jre="appletviewer idlj jaotc jar jarsigner java javac javadoc javap javapackager javaws jcmd jconsole jcontrol jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd jweblauncher keytool orbd pack200 rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc" + oracle_bin_jdk=" " + oracle_jre_bin_hl=" " + oracle_jre_bin_jre=" " + fi + # JDK 9 GA release (jdk-9.0.1_linux-x64_bin.tar.gz) if [[ $archive_name =~ jdk-9(\.([0-9]+)\.([0-9]+))?_linux-x64_bin\.tar\.gz ]] then @@ -143,8 +159,8 @@ fi install_no_man_alternatives $jvm_base$j2se_name/jre/lib $oracle_jre_lib_hl install_alternatives $jvm_base$j2se_name/bin $oracle_bin_jdk -# No plugin for ARM architecture yet -if [ "${DEB_BUILD_ARCH:0:3}" != "arm" ]; then +# No plugin for ARM architecture yet and no plugin in Java 10 later +if [[ "${DEB_BUILD_ARCH:0:3}" != "arm" && "${j2se_release}" -lt "10" ]]; then plugin_dir="$jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH" for b in $browser_plugin_dirs;do install_browser_plugin "/usr/lib/\$b/plugins" "libjavaplugin.so" "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so" @@ -167,8 +183,8 @@ fi remove_alternatives $jvm_base$j2se_name/jre/lib $oracle_jre_lib_hl remove_alternatives $jvm_base$j2se_name/bin $oracle_bin_jdk -# No plugin for ARM architecture yet -if [ "${DEB_BUILD_ARCH:0:3}" != "arm" ]; then +# No plugin for ARM architecture yet and no plugin in Java 10 and later +if [[ "${DEB_BUILD_ARCH:0:3}" != "arm" && "${j2se_release}" -lt "10" ]]; then plugin_dir="$jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH" for b in $browser_plugin_dirs;do remove_browser_plugin "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so" diff --git a/lib/oracle-jre.sh b/lib/oracle-jre.sh index 331f7de..20d93a6 100644 --- a/lib/oracle-jre.sh +++ b/lib/oracle-jre.sh @@ -3,6 +3,20 @@ j2se_detect_oracle_j2re=oracle_j2re_detect oracle_j2re_detect() { j2se_release=0 + # JRE 10 release candidate (oracle-java10-jre_10+46_amd64.deb) + if [[ $archive_name =~ ^jre-10(\.([0-9]+)\.([0-9]+)|\+[0-9]+)?_linux-x64_bin\.tar\.gz ]] + then + j2se_release=10 + j2se_update=${BASH_REMATCH[1]:-.0.0} + j2se_arch=x64 + j2se_version_name="${j2se_release} version ${j2se_release}${j2se_update}" + j2se_version=${j2se_release}${j2se_update}${revision} + oracle_no_man_jre_bin_jre="appletviewer idlj java javaws jcontrol jjs jrunscript jweblauncher keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200" + oracle_jre_bin_hl=" " + oracle_jre_bin_jre=" " + oracle_jre_lib_hl=" " + fi + # JRE 9 GA release (jre-9.0.1_linux-x64_bin.tar.gz) if [[ $archive_name =~ ^jre-9(\.([0-9]+)\.([0-9]+))?_linux-x64_bin\.tar\.gz ]] then @@ -87,10 +101,10 @@ EOF j2se_remove=oracle_j2re_remove j2se_jinfo=oracle_j2re_jinfo j2se_control=oracle_j2re_control - oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool" - oracle_jre_bin_jre="javaws policytool" - oracle_no_man_jre_bin_jre="ControlPanel jcontrol" - oracle_jre_lib_hl="jexec" + oracle_jre_bin_hl="${oracle_jre_bin_hl:-java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool}" + oracle_jre_bin_jre="${oracle_jre_bin_jre:-javaws policytool}" + oracle_no_man_jre_bin_jre="${oracle_no_man_jre_bin_jre:-ControlPanel jcontrol}" + oracle_jre_lib_hl="${oracle_jre_lib_hl:-jexec}" j2se_package="$j2se_vendor-java$j2se_release-jre" j2se_run fi @@ -108,10 +122,12 @@ install_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_jre install_no_man_alternatives $jvm_base$j2se_name/bin $oracle_no_man_jre_bin_jre install_no_man_alternatives $jvm_base$j2se_name/lib $oracle_jre_lib_hl -plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH" -for b in $browser_plugin_dirs;do - install_browser_plugin "/usr/lib/\$b/plugins" "libjavaplugin.so" "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so" -done +if [[ "${j2se_release}" -lt "10" ]]; then + plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH" + for b in $browser_plugin_dirs;do + install_browser_plugin "/usr/lib/\$b/plugins" "libjavaplugin.so" "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so" + done +fi EOF } @@ -126,10 +142,12 @@ remove_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_jre remove_alternatives $jvm_base$j2se_name/bin $oracle_no_man_jre_bin_jre remove_alternatives $jvm_base$j2se_name/lib $oracle_jre_lib_hl -plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH" -for b in $browser_plugin_dirs;do - remove_browser_plugin "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so" -done +if [[ "${j2se_release}" -lt "10" ]]; then + plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH" + for b in $browser_plugin_dirs;do + remove_browser_plugin "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so" + done +fi EOF } -- 2.39.5