Merge ~vpa1977/ubuntu/+source/icedtea-web:java21-ftbfs into ubuntu/+source/icedtea-web:ubuntu/devel

Proposed by Vladimir Petko
Status: Merged
Merged at revision: 17fdceef01975155c0d1944ca527db7eb9258220
Proposed branch: ~vpa1977/ubuntu/+source/icedtea-web:java21-ftbfs
Merge into: ubuntu/+source/icedtea-web:ubuntu/devel
Diff against target: 162 lines (+122/-1)
5 files modified
debian/changelog (+6/-0)
debian/control (+2/-1)
debian/patches/jdk-21-autoconf.patch (+74/-0)
debian/patches/jdk-21-jarindex.patch (+38/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Canonical Foundations Team Pending
Ubuntu Sponsors Pending
git-ubuntu import Pending
Review via email: mp+460570@code.launchpad.net

Description of the change

This MP resolves Java 21 ftbfs.

PPA: ppa:vpa1977/gettext [1]

Changes:
 - Use java_compat_level variable provided by java-common to adjust -source/-target level to the minimum required by the default Java

Testing:
 - rebuild in default Java 21 ppa[2]
 - piuparts test [3]
 - basic functionality test:
$wget https://docs.oracle.com/javase/tutorialJWS/samples/deployment/dynamictree_webstartJWSProject/dynamictree_webstart.jnlp

$/usr/share/icedtea-web/bin/javaws.sh dynamictree_webstart.jnlp
The applet should start without exceptions.
----
ARNING: package sun.applet not in java.desktop
WARNING: package com.sun.net.ssl.internal.ssl not in java.base
WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
Gtk-Message: 00:27:28.931: Failed to load module "canberra-gtk-module"
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by net.sourceforge.jnlp.runtime.JNLPRuntime
WARNING: Please consider reporting this to the maintainers of net.sourceforge.jnlp.runtime.JNLPRuntime
WARNING: System::setSecurityManager will be removed in a future release
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
Codebase matches codebase manifest attribute, but application is unsigned. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
The 'permissions' attribute is 'sandbox' and the applet is signed. Forcing sandbox.
The 'permissions' attribute is 'sandbox' and the applet is signed. Forcing sandbox.
Starting application [webstartComponentArch.DynamicTreeApplication] ...
----
Test pass.

[1] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext
[2] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext-21/+sourcepub/15789203/+listing-archive-extra
[3] https://bugs.launchpad.net/ubuntu/+source/icedtea-web/+bug/2053208/comments/1

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index d294113..454d91d 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+icedtea-web (1.8.8-2ubuntu1) noble; urgency=medium
7+
8+ * d/p/jdk-21-*: add Java 21 compatibility patches (LP: #2053208).
9+
10+ -- Vladimir Petko <vladimir.petko@canonical.com> Thu, 15 Feb 2024 20:50:42 +1300
11+
12 icedtea-web (1.8.8-2) unstable; urgency=medium
13
14 * Team upload.
15diff --git a/debian/control b/debian/control
16index 175a02f..54b8350 100644
17--- a/debian/control
18+++ b/debian/control
19@@ -1,7 +1,8 @@
20 Source: icedtea-web
21 Section: java
22 Priority: optional
23-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
24+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
25+XSBC-Original-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
26 Uploaders: Matthias Klose <doko@ubuntu.com>
27 Build-Depends:
28 debhelper-compat (= 12),
29diff --git a/debian/patches/jdk-21-autoconf.patch b/debian/patches/jdk-21-autoconf.patch
30new file mode 100644
31index 0000000..2c3f9af
32--- /dev/null
33+++ b/debian/patches/jdk-21-autoconf.patch
34@@ -0,0 +1,74 @@
35+Description: Support compilation with JDK 21
36+ Modify autoconf scripts to support compilation with JDK 21.
37+ Upstream has removed autoconf/make-based building, but hasn't
38+ released it yet. So, this patch need not be forwarded upstream.
39+Author: Pushkar Kulkarni <pushkar.kulkarni@canonical.com>
40+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052691
41+Forwarded: not-needed
42+---
43+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
44+--- a/acinclude.m4
45++++ b/acinclude.m4
46+@@ -846,10 +846,12 @@
47+ AC_MSG_RESULT($JAVA_VERSION)
48+ if test "${JAVA_VERSION}" -eq "8"; then
49+ HAVE_JAVA8="yes"
50++ elif test "$JAVA_VERSION" -ge "21"; then
51++ HAVE_JAVA21="yes"
52+ elif test "$JAVA_VERSION" -ge "9"; then
53+ HAVE_JAVA9="yes"
54+ fi
55+- if test -z "$HAVE_JAVA8" -a -z "$HAVE_JAVA9"; then
56++ if test -z "$HAVE_JAVA8" -a -z "$HAVE_JAVA9" -a -z "$HAVE_JAVA21"; then
57+ AC_MSG_ERROR([JDK8 or newer is required, detected was: $JAVA_VERSION])
58+ fi
59+ if ! test -z "$HAVE_JAVA8"; then
60+@@ -861,6 +863,7 @@
61+ AC_SUBST(VERSION_DEFS)
62+ AM_CONDITIONAL([HAVE_JAVA8], test x"${HAVE_JAVA8}" = "xyes")
63+ AM_CONDITIONAL([HAVE_JAVA9], test x"${HAVE_JAVA9}" = "xyes")
64++ AM_CONDITIONAL([HAVE_JAVA21], test x"${HAVE_JAVA21}" = "xyes")
65+ ])
66+
67+ AC_DEFUN_ONCE([IT_FIND_KEYTOOL],
68+--- a/configure.ac
69++++ b/configure.ac
70+@@ -149,11 +149,14 @@
71+ dnl IT575 - Plugin depends on com.sun/jndi.toolkit.url.UrlUtil
72+ dnl IT576 - Plugin depends on sun.applet.AppletImageRef
73+ dnl IT578 - Remove need for patching AppletPanel for Plugin/Webstart
74+-if test x"$HAVE_JAVA9" = xyes ; then
75++if test x"$HAVE_JAVA9" = xyes -o x"$HAVE_JAVA21" = xyes ; then
76+ JAVA_BASE=java.base
77+ JAVA_DESKTOP=java.desktop
78+ JAVA_NAMING=java.naming
79+ fi
80++if test x"$HAVE_JAVA21" = xyes ; then
81++ JDK_JARTOOL=jdk.jartool
82++fi
83+ IT_CHECK_FOR_CLASS(JAVA_NET_COOKIEMANAGER, [java.net.CookieManager], [some.pkg], [])
84+ IT_CHECK_FOR_CLASS(JAVA_NET_HTTPCOOKIE, [java.net.HttpCookie], [some.pkg], [])
85+ IT_CHECK_FOR_CLASS(JAVA_NET_COOKIEHANDLER, [java.net.CookieHandler], [some.pkg], [])
86+@@ -163,13 +166,17 @@
87+ IT_CHECK_FOR_CLASS(SUN_SECURITY_X509_X500NAME, [sun.security.x509.X500Name], [some.pkg], [$JAVA_BASE])
88+ IT_CHECK_FOR_CLASS(SUN_SECURITY_ACTION_GETPROPERTYACTION, [sun.security.action.GetPropertyAction], [some.pkg], [$JAVA_BASE])
89+ # the classname cant be substitued by variable, as it is substituted to inner class
90+-if test x"$HAVE_JAVA9" = xyes ; then
91++if test x"$HAVE_JAVA21" = xyes ; then
92+ IT_CHECK_FOR_CLASS(HEXDUMPENCODER, [sun.security.util.HexDumpEncoder], [some.pkg], [$JAVA_BASE])
93+- IT_CHECK_FOR_CLASS(SUN_MISC_JARINDEX, [jdk.internal.util.jar.JarIndex], [some.pkg], [$JAVA_BASE])
94+ else
95+- IT_CHECK_FOR_CLASS(HEXDUMPENCODER, [sun.misc.HexDumpEncoder], [some.pkg], [$JAVA_BASE])
96+- IT_CHECK_FOR_CLASS(SUN_MISC_JARINDEX, [sun.misc.JarIndex], [some.pkg], [$JAVA_BASE])
97+- IT_CHECK_FOR_CLASS(SUN_MISC_LAUNCHER, [sun.misc.Launcher], [some.pkg], [$JAVA_BASE])
98++ if test x"$HAVE_JAVA9" = xyes ; then
99++ IT_CHECK_FOR_CLASS(HEXDUMPENCODER, [sun.security.util.HexDumpEncoder], [some.pkg], [$JAVA_BASE])
100++ IT_CHECK_FOR_CLASS(SUN_MISC_JARINDEX, [jdk.internal.util.jar.JarIndex], [some.pkg], [$JAVA_BASE])
101++ else
102++ IT_CHECK_FOR_CLASS(HEXDUMPENCODER, [sun.misc.HexDumpEncoder], [some.pkg], [$JAVA_BASE])
103++ IT_CHECK_FOR_CLASS(SUN_MISC_JARINDEX, [sun.misc.JarIndex], [some.pkg], [$JAVA_BASE])
104++ IT_CHECK_FOR_CLASS(SUN_MISC_LAUNCHER, [sun.misc.Launcher], [some.pkg], [$JAVA_BASE])
105++ fi
106+ fi
107+ IT_CHECK_FOR_CLASS(SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION, [sun.security.validator.ValidatorException], [some.pkg], [$JAVA_BASE])
108+ IT_CHECK_FOR_CLASS(SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE, [sun.net.www.protocol.jar.URLJarFile], [some.pkg], [$JAVA_BASE])
109diff --git a/debian/patches/jdk-21-jarindex.patch b/debian/patches/jdk-21-jarindex.patch
110new file mode 100644
111index 0000000..9c90fb3
112--- /dev/null
113+++ b/debian/patches/jdk-21-jarindex.patch
114@@ -0,0 +1,38 @@
115+Description: Support for compilation with JDK 21
116+ Adds a dummy implementation of JarIndex to support compilation with JDK 21.
117+ Most of the JDK's JarIndex functionality was moved to an internal class.
118+Origin: upstream, https://github.com/AdoptOpenJDK/IcedTea-Web/commits/b2fb1428e81620c15025bda373f949eb79edbbb4
119+Author: Stephan Classen <st.classen@gmx.ch>
120+Bug: https://github.com/AdoptOpenJDK/IcedTea-Web/pull/925
121+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052691
122+---
123+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
124+--- a/netx/net/sourceforge/jnlp/jdk89acesses/JarIndexAccess.java
125++++ b/netx/net/sourceforge/jnlp/jdk89acesses/JarIndexAccess.java
126+@@ -28,7 +28,7 @@
127+ jarIndexClass = Class.forName("jdk.internal.util.jar.JarIndex");
128+ } catch (ClassNotFoundException exx) {
129+ OutputController.getLogger().log(exx);
130+- throw new RuntimeException("JarIndex not found!");
131++ jarIndexClass = JarIndexDummy.class;
132+ }
133+ }
134+ }
135+@@ -71,4 +71,17 @@
136+ return (LinkedList<String>) o;
137+ }
138+
139++ /**
140++ * Because starting of JAVA 21 the JarIndex is no longer supported we provide a dummy implementation which always returns {@code null}.
141++ */
142++ @SuppressWarnings("unused")
143++ private static class JarIndexDummy {
144++ public static Object getJarIndex(JarFile jar) {
145++ return null;
146++ }
147++
148++ public Object get(String fileName) {
149++ return null;
150++ }
151++ }
152+ }
153diff --git a/debian/patches/series b/debian/patches/series
154index 247c316..5ac9511 100644
155--- a/debian/patches/series
156+++ b/debian/patches/series
157@@ -6,3 +6,5 @@ java11-compatibility.diff
158 reproducible-documentation.patch
159 remove-pack200-support.patch
160 build-with-java17.diff
161+jdk-21-autoconf.patch
162+jdk-21-jarindex.patch

Subscribers

People subscribed via source and target branches