/hg/icedtea-web: javaws -html made run under jdk9 (if compiled b...

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Thu Nov 3 12:12:31 UTC 2016


changeset 2cb12ef65318 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=2cb12ef65318
author: Jiri Vanek <jvanek at redhat.com>
date: Thu Nov 03 13:17:51 2016 +0100

	javaws -html made run under jdk9 (if compiled by jdk8)

	* .Makefile: (stamps/liveconnect-dist.stamp)(install-exec-local) plugin jar split to plugin.jar (sun package) and jsobject.jar (nescape package) so each can be patched into different module
	* launcher/launchers.in: all add-exports and add-reads now adds to java.desktop too (next to ALL-UNNAMED). plugin.jar and netx.jar patched into java.desktop. jsobject.jar patched into jdk.jsobject


diffstat:

 ChangeLog             |  11 ++++++++++
 Makefile.am           |  24 ++++++++++++++++-----
 launcher/launchers.in |  55 +++++++++++++++++++++++++-------------------------
 3 files changed, 57 insertions(+), 33 deletions(-)

diffs (219 lines):

diff -r ef2c2def287a -r 2cb12ef65318 ChangeLog
--- a/ChangeLog	Tue Nov 01 17:04:13 2016 +0100
+++ b/ChangeLog	Thu Nov 03 13:17:51 2016 +0100
@@ -1,3 +1,14 @@
+2016-11-03  Jiri Vanek <jvanek at redhat.com>
+
+	javaws -html made run under jdk9 (if compiled by jdk8)
+	* .Makefile: (stamps/liveconnect-dist.stamp)(install-exec-local)
+	plugin jar split to plugin.jar (sun package) and jsobject.jar
+	(nescape package) so each can be patched into different module
+	* launcher/launchers.in: all add-exports and add-reads now adds to
+	java.desktop too (next to ALL-UNNAMED). plugin.jar and netx.jar 
+	patched into java.desktop. jsobject.jar patched into jdk.jsobject
+
+
 2016-11-01  Jiri Vanek <jvanek at redhat.com>
 
 	javaws made run under jdk9 (if compiled by jdk8)
diff -r ef2c2def287a -r 2cb12ef65318 Makefile.am
--- a/Makefile.am	Tue Nov 01 17:04:13 2016 +0100
+++ b/Makefile.am	Thu Nov 03 13:17:51 2016 +0100
@@ -111,8 +111,10 @@
 JUNIT_RUNTIME:=$(JUNIT_JAR) $(HAMCREST_JAR)
 
 # support for javaws -html needs plugin.jar on classpath. rest of javaws works of course without it.
+# plugin jar is split into plugin.jar and jsobject.jar so it can run with modular (9+) jdk
 if ENABLE_PLUGIN
   PLUGIN_JAR=$(datadir)/$(PACKAGE_NAME)/plugin.jar
+  JSOBJECT_JAR=$(datadir)/$(PACKAGE_NAME)/jsobject.jar
 endif
 
 # Conditional defintions
@@ -136,7 +138,7 @@
 #    IllegalAccessException
 #  - we want full privileges
 #
-export UNIFIED_CLASSPATH_SEGMENTS=$(datadir)/$(PACKAGE_NAME)/netx.jar $(PLUGIN_JAR) $(RHINO_JAR) $(TAGSOUP_JAR)
+export UNIFIED_CLASSPATH_SEGMENTS=$(datadir)/$(PACKAGE_NAME)/netx.jar $(PLUGIN_JAR) $(JSOBJECT_JAR) $(RHINO_JAR) $(TAGSOUP_JAR)
 export UNIFIED_JACOCO_CLASSPATH_SEGMENTS=$(UNIFIED_CLASSPATH_SEGMENTS) $(JACOCO_CLASSPATH)
 export UNIFIED_CLASSPATH=$(call joinsegments, $(UNIFIED_CLASSPATH_SEGMENTS))
 export UNIFIED_JACOCO_CLASSPATH=$(call joinsegments, $(UNIFIED_JACOCO_CLASSPATH_SEGMENTS))
@@ -165,7 +167,9 @@
 
 if ENABLE_PLUGIN
 export ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin
-export LIVECONNECT_DIR = netscape sun/applet
+export JSOBJECT_DIRS = netscape
+export SUN_APPLET_DIRS = sun/applet
+export LIVECONNECT_DIR = $(JSOBJECT_DIRS) $(SUN_APPLET_DIRS)
 export PLUGIN_DIR=$(abs_top_builddir)/plugin/icedteanp
 export PLUGIN_SRCDIR=$(abs_top_srcdir)/plugin/icedteanp
 export LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java
@@ -252,6 +256,9 @@
   -e "s|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g" \
   -e "s|[@]MAIN_CLASS[@]|$${MAIN_CLASS}|g" \
   -e "s|[@]BIN_LOCATION[@]|$${BIN_LOCATION}|g" \
+  -e "s|[@]NETX_JAR[@]|$(datadir)/$(PACKAGE_NAME)/netx.jar|g" \
+  -e "s|[@]PLUGIN_JAR[@]|$(PLUGIN_JAR)|g" \
+  -e "s|[@]JSOBJECT_JAR[@]|$(JSOBJECT_JAR)|g" \
   -e "s|[@]PROGRAM_NAME[@]|$${PROGRAM_NAME}|g"
 
 # Top-Level Targets
@@ -278,7 +285,8 @@
 	${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) $(ICONS_DEST_DIR) $(BASH_CMPL_DEST_DIR)
 if ENABLE_PLUGIN
 	${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)
-	${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
+	${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes-applet.jar   $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
+	${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes-jsobject.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/jsobject.jar
 endif
 	${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
 	${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
@@ -312,6 +320,7 @@
 uninstall-local:
 	rm -f $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)
 	rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
+	rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/jsobject.jar
 	rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
 	rm -r $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
 	rm -r $(ICONS_DEST_DIR)/javaws.png
@@ -478,11 +487,16 @@
 	mkdir -p stamps
 	touch $@
 
+# although sun and netscape packages were compiled together, we pack and install them as two jars, to follow java.desktop and jdk.jsobject jdk9 modules
+# the all together jar is kept for usage in tests. Feel free to remove and refactor
+
 stamps/liveconnect-dist.stamp: stamps/liveconnect.stamp
 	if test "x${LIVECONNECT_DIR}" != x; then \
 	  (cd $(abs_top_builddir)/liveconnect ; \
 	   mkdir -p lib ; \
-	   $(SYSTEM_JDK_DIR)/bin/jar cf lib/classes.jar $(LIVECONNECT_DIR) ; \
+	   $(SYSTEM_JDK_DIR)/bin/jar cf lib/classes.jar          $(LIVECONNECT_DIR) ; \
+	   $(SYSTEM_JDK_DIR)/bin/jar cf lib/classes-applet.jar   $(SUN_APPLET_DIRS) ; \
+	   $(SYSTEM_JDK_DIR)/bin/jar cf lib/classes-jsobject.jar $(JSOBJECT_DIRS)   ; \
 	   cp -pPR $(SRC_DIR_LINK) $(LIVECONNECT_SRCS) src; \
 	   find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \
 	   cd src ; \
@@ -498,8 +512,6 @@
 	rm -f stamps/liveconnect.stamp
 
 # NetX
-# requires availability of OpenJDK source code including
-# a patch applied to sun.plugin.AppletViewerPanel and generated sources
 
 netx-source-files.txt:
 	find $(NETX_SRCDIR) -name '*.java' | sort > $@ ; \
diff -r ef2c2def287a -r 2cb12ef65318 launcher/launchers.in
--- a/launcher/launchers.in	Tue Nov 01 17:04:13 2016 +0100
+++ b/launcher/launchers.in	Thu Nov 03 13:17:51 2016 +0100
@@ -79,80 +79,81 @@
 k=$((k+1))
 
 if [ "x$JDK9" == "xYES" ] ; then
-#COMMAND[k]="--patch-module"
-#k=$((k+1))
-#COMMAND[k]="java.base=."
-#k=$((k+1))
-#COMMAND[k]="--patch-module"
-#k=$((k+1))
-#COMMAND[k]="java.desktop=."
-#k=$((k+1))
-#COMMAND[k]="--patch-module"
-#k=$((k+1))
-#COMMAND[k]="java.naming=."
-#k=$((k+1))
+
+COMMAND[k]="--patch-module"
+k=$((k+1))
+COMMAND[k]="java.desktop=@PLUGIN_JAR@:@NETX_JAR@"
+k=$((k+1))
+
+# jsobject must be pathched separately from plugin
+# otherwise netscape pkg would be shared by two modules, which is forbiden
+COMMAND[k]="--patch-module"
+k=$((k+1))
+COMMAND[k]="jdk.jsobject=@JSOBJECT_JAR@"
+k=$((k+1))
+
 
 COMMAND[k]="--add-reads"
 k=$((k+1))
-COMMAND[k]="java.base=ALL-UNNAMED"
+COMMAND[k]="java.base=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-reads"
 k=$((k+1))
-COMMAND[k]="java.desktop=ALL-UNNAMED"
+COMMAND[k]="java.desktop=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-reads"
 k=$((k+1))
-COMMAND[k]="java.naming=ALL-UNNAMED"
+COMMAND[k]="java.naming=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.desktop/sun.awt=ALL-UNNAMED"
+COMMAND[k]="java.desktop/sun.awt=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/sun.security.provider=ALL-UNNAMED"
+COMMAND[k]="java.base/sun.security.provider=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/sun.security.util=ALL-UNNAMED"
+COMMAND[k]="java.base/sun.security.util=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/sun.security.x509=ALL-UNNAMED"
+COMMAND[k]="java.base/sun.security.x509=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/jdk.internal.util.jar=ALL-UNNAMED"
+COMMAND[k]="java.base/jdk.internal.util.jar=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/sun.security.validator=ALL-UNNAMED"
+COMMAND[k]="java.base/sun.security.validator=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/com.sun.net.ssl.internal.ssl=ALL-UNNAMED"
+COMMAND[k]="java.base/com.sun.net.ssl.internal.ssl=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/sun.net.www.protocol.jar=ALL-UNNAMED"
+COMMAND[k]="java.base/sun.net.www.protocol.jar=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.desktop/sun.awt.X11=ALL-UNNAMED"
+COMMAND[k]="java.desktop/sun.awt.X11=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.naming/com.sun.jndi.toolkit.url=ALL-UNNAMED"
+COMMAND[k]="java.naming/com.sun.jndi.toolkit.url=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.desktop/sun.applet=ALL-UNNAMED"
+COMMAND[k]="java.desktop/sun.applet=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 
 COMMAND[k]="--add-exports"
 k=$((k+1))
-COMMAND[k]="java.base/sun.security.action=ALL-UNNAMED"
+COMMAND[k]="java.base/sun.security.action=ALL-UNNAMED,java.desktop"
 k=$((k+1))
 fi
 


More information about the distro-pkg-dev mailing list