]> git.sven.stormbind.net Git - sven/java-package.git/commitdiff
Basic support for Java 10
authorSven Höxter <sven.hoexter@rewe-digital.com>
Fri, 9 Mar 2018 18:14:10 +0000 (19:14 +0100)
committerSven Höxter <sven.hoexter@rewe-digital.com>
Fri, 9 Mar 2018 18:14:10 +0000 (19:14 +0100)
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
lib/oracle-jre.sh

index f12d95f59ee783089f6f74c722f820cbbad66093..54f38298c2895fc493bd41700ac270017523d309 100644 (file)
@@ -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"
index 331f7de17e1f78dc38b0b4da8f522c65a9ce5392..20d93a67e30ddbc060f1b0c6cf892e91e1ed65c1 100644 (file)
@@ -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
 }