diff --git a/WHATSNEW b/WHATSNEW index aa2e15183..df270d8a6 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -141,8 +141,8 @@ Changes that could break older environments: set failOnError to false. Bugzilla Report 47362. - * Ant now uses the java.runtime.version instead of java.vm.version - system property for the Created-By Manifest attribute. + * Ant now prefers the java.runtime.version system property over + java.vm.version for the Created-By Manifest attribute. Bugzilla Report 47632. Fixed bugs: diff --git a/src/main/org/apache/tools/ant/taskdefs/Manifest.java b/src/main/org/apache/tools/ant/taskdefs/Manifest.java index 39a650a8d..378dcfbdb 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Manifest.java +++ b/src/main/org/apache/tools/ant/taskdefs/Manifest.java @@ -745,8 +745,12 @@ public class Manifest { try { insr = new InputStreamReader(in, "UTF-8"); Manifest defaultManifest = new Manifest(insr); + String version = System.getProperty("java.runtime.version"); + if (version == null) { + version = System.getProperty("java.vm.version"); + } Attribute createdBy = new Attribute("Created-By", - System.getProperty("java.runtime.version") + " (" + version + " (" + System.getProperty("java.vm.vendor") + ")"); defaultManifest.getMainSection().storeAttribute(createdBy); return defaultManifest;