Example usage for com.google.common.base StandardSystemProperty JAVA_SPECIFICATION_VERSION

List of usage examples for com.google.common.base StandardSystemProperty JAVA_SPECIFICATION_VERSION

Introduction

In this page you can find the example usage for com.google.common.base StandardSystemProperty JAVA_SPECIFICATION_VERSION.

Prototype

StandardSystemProperty JAVA_SPECIFICATION_VERSION

To view the source code for com.google.common.base StandardSystemProperty JAVA_SPECIFICATION_VERSION.

Click Source Link

Document

Java Runtime Environment specification version.

Usage

From source file:com.facebook.presto.server.PrestoJvmRequirements.java

public static void verifyJvmRequirements() {
    String specVersion = StandardSystemProperty.JAVA_SPECIFICATION_VERSION.value();
    if ((specVersion == null) || (specVersion.compareTo("1.8") < 0)) {
        failRequirement("Presto requires Java 1.8+ (found %s)", specVersion);
    }/*from  ww w.  j  av a2  s  . c o m*/

    String vendor = StandardSystemProperty.JAVA_VENDOR.value();
    if (!"Oracle Corporation".equals(vendor)) {
        failRequirement("Presto requires an Oracle or OpenJDK JVM (found %s)", vendor);
    }

    String dataModel = System.getProperty("sun.arch.data.model");
    if (!"64".equals(dataModel)) {
        failRequirement("Presto requires a 64-bit JVM (found %s)", dataModel);
    }

    String osName = StandardSystemProperty.OS_NAME.value();
    String osArch = StandardSystemProperty.OS_ARCH.value();
    if ("Linux".equals(osName)) {
        if (!"amd64".equals(osArch)) {
            failRequirement("Presto requires x86-64 or amd64 on Linux (found %s)", osArch);
        }
    } else if ("Mac OS X".equals(osName)) {
        if (!"x86_64".equals(osArch)) {
            failRequirement("Presto requires x86_64 on Mac OS X (found %s)", osArch);
        }
    } else {
        failRequirement("Presto requires Linux or Mac OS X (found %s)", osName);
    }

    if (!ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) {
        failRequirement("Presto requires a little endian platform (found %s)", ByteOrder.nativeOrder());
    }

    verifySlice();
}

From source file:org.killbill.billing.server.updatechecker.ClientInfo.java

public String getJavaSpecificationVersion() {
    return getProperty(StandardSystemProperty.JAVA_SPECIFICATION_VERSION);
}