--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties Wed Nov 16 19:52:20 2016 +0530
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties Wed Nov 16 10:52:08 2016 -0400
@@ -63,7 +63,10 @@
\ --save-opts <filename> Save jlink options in the given file
main.opt.ignore-signing-information=\
-\ --ignore-signing-information Ignore signing information in modular JARs
+\ --ignore-signing-information Suppress a fatal error when signed modular JARs \
+\ are linked in the image. The signature related \
+\ files of the signed modular JARs are not copied \
+\ to the runtime image.
main.msg.bug=\
An exception has occurred in jlink. \
@@ -110,6 +113,6 @@
err.not.modular.format=selected module {0} ({1}) not in jmod or modular JAR format
err.signing=signed modular JAR {0} is currently not supported,\
\ use --ignore-signing-information to suppress error
-warn.signing=signed modular JAR {0} is currently not supported
+warn.signing=WARNING: signed modular JAR {0} is currently not supported
warn.invalid.arg=invalid classname or pathname not exist: {0}
warn.split.package=package {0} defined in {1} {2}
--- a/jdk/test/tools/jlink/JLinkSigningTest.java Wed Nov 16 19:52:20 2016 +0530
+++ b/jdk/test/tools/jlink/JLinkSigningTest.java Wed Nov 16 10:52:08 2016 -0400
@@ -26,24 +26,31 @@
* @bug 8159393
* @summary Test signed jars involved in image creation
* @modules java.base/jdk.internal.jimage
- * jdk.jlink/jdk.tools.jlink.internal
+ * java.base/sun.security.tools.keytool
* jdk.compiler/com.sun.tools.javac
- * java.base/sun.security.tools.keytool
* jdk.jartool/sun.security.tools.jarsigner
* jdk.jartool/sun.tools.jar
+ * jdk.jlink/jdk.tools.jlink.internal
* @run main/othervm JLinkSigningTest
*/
import java.io.File;
import java.io.IOException;
-import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
+import java.util.spi.ToolProvider;
public class JLinkSigningTest {
+ private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar")
+ .orElseThrow(() -> new RuntimeException("jar tool not found"));
+ private static final ToolProvider JAVAC_TOOL = ToolProvider.findFirst("javac")
+ .orElseThrow(() -> new RuntimeException("javac tool not found"));
+ private static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
+ .orElseThrow(() -> new RuntimeException("jlink tool not found"));
+
static final String[] MODULE_INFO = {
"module test {",
"}",
@@ -61,22 +68,29 @@
System.out.println(command + " " + String.join(" ", Arrays.asList(args)));
}
- static void javac(String[] args) {
- report("javac", args);
- com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();
+ static void jar(String[] args) {
+ report("jar", args);
+ JAR_TOOL.run(System.out, System.err, args);
+ }
- if (javac.compile(args) != 0) {
- throw new RuntimeException("javac failed");
+ static void jarsigner(String[] args) {
+ report("jarsigner", args);
+
+ try {
+ sun.security.tools.jarsigner.Main.main(args);
+ } catch (Exception ex) {
+ throw new RuntimeException("jarsigner not found");
}
}
- static void jar(String[] args) {
- report("jar", args);
- sun.tools.jar.Main jar = new sun.tools.jar.Main(System.out, System.err, "jar");
+ static void javac(String[] args) {
+ report("javac", args);
+ JAVAC_TOOL.run(System.out, System.err, args);
+ }
- if (!jar.run(args)) {
- throw new RuntimeException("jar failed");
- }
+ static void jlink(String[] args) {
+ report("jlink", args);
+ JLINK_TOOL.run(System.out, System.err, args);
}
static void keytool(String[] args) {
@@ -89,28 +103,6 @@
}
}
- static void jarsigner(String[] args) {
- report("jarsigner", args);
-
- try {
- sun.security.tools.jarsigner.Main.main(args);
- } catch (Exception ex) {
- throw new RuntimeException("jarsigner failed");
- }
- }
-
- static void jlink(String[] args) {
- report("jlink", args);
-
- try {
- jdk.tools.jlink.internal.Main.run(new PrintWriter(System.out, true),
- new PrintWriter(System.err, true),
- args);
- } catch (Exception ex) {
- throw new RuntimeException("jlink failed");
- }
- }
-
public static void main(String[] args) {
final String JAVA_HOME = System.getProperty("java.home");
Path moduleInfoJavaPath = Paths.get("module-info.java");