org.mockserver.java.JDKVersion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-core Show documentation
Show all versions of mockserver-core Show documentation
Functionality used by all MockServer modules for matching and expectations
package org.mockserver.java;
import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang3.StringUtils;
public class JDKVersion {
@VisibleForTesting
public static String javaVersion = System.getProperty("java.version");
public static int getVersion() {
String version = javaVersion;
if (version.startsWith("1.")) {
version = StringUtils.substringAfter(version, ".");
}
return Integer.parseInt(StringUtils.substringBefore(version, "."));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy