mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-29 04:25:23 +00:00
Use java.specification.version
This commit is contained in:
1 parent
f55864fe49
commit
5cdbf39d9c
2 files changed
+4
-7
No files matched your search
@@ -465,10 +465,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
*/
|
||||
@Exported
|
||||
public @CheckForNull String getRequiredJavaVersion() {
|
||||
String v = manifest.getMainAttributes().getValue("Minimum-Java-Version");
|
||||
if (v!= null) return v;
|
||||
|
||||
return null;
|
||||
return manifest.getMainAttributes().getValue("Minimum-Java-Version");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -617,8 +614,8 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
|
||||
String requiredJavaVersion = getRequiredJavaVersion();
|
||||
if (requiredJavaVersion != null) {
|
||||
// TODO replace with calls to Runtime.version() once we're on Java 9
|
||||
VersionNumber actualVersion = new VersionNumber(System.getProperty("java.version"));
|
||||
// TODO replace with calls to Runtime.version() once we're on Java 9+
|
||||
VersionNumber actualVersion = new VersionNumber(System.getProperty("java.specification.version"));
|
||||
if (actualVersion.isOlderThan(new VersionNumber(requiredJavaVersion))) {
|
||||
dependencyErrors.add(Messages.PluginWrapper_obsoleteJava(actualVersion.toString(), requiredJavaVersion));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user