com.ibm.as400.access.JVMInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jt400 Show documentation
Show all versions of jt400 Show documentation
The Open Source version of the IBM Toolbox for Java
///////////////////////////////////////////////////////////////////////////////
//
// JTOpen (IBM Toolbox for Java - OSS version)
//
// Filename: JVMInfo.java
//
// The source code contained herein is licensed under the IBM Public License
// Version 1.0, which has been approved by the Open Source Initiative.
// Copyright (C) 2012 International Business Machines Corporation and
// others. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////
package com.ibm.as400.access;
/**
Provide information about the currently running JVM.
**/
public class JVMInfo
{
static String javaVersion = null;
static boolean jdk16;
protected static void initializeJavaVersion() {
String version = System.getProperty("java.version");
if (version != null) {
if (version.length() > 2) {
if (version.charAt(0) == '1' && version.charAt(2) < '6') {
jdk16 = false;
} else {
jdk16 = true;
}
} else {
// Android JVM returns 0 and runs with JDK 1.5
if ("0".equals(version)) {
jdk16 = false;
}
// Java 9 return 9
if ("9".equals(version)) {
jdk16 = true;
}
}
}
}
/*
* Is the JVM running JDK 1.6 or later.
*/
public static boolean isJDK16() {
if (javaVersion == null) {
initializeJavaVersion();
}
return jdk16;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy