📄 jre.java
字号:
package org.loon.framework.ide.test;
/**
* <p>Title: LoonFramework</p>
* <p>Description:</p>
* <p>Copyright: Copyright (c) 2007</p>
* <p>Company: LoonFramework</p>
* @author chenpeng
* @email:ceponline@yahoo.com.cn
* @version 0.1
*/
public abstract class JRE {
private static final int JAVA_14 = 1;
private static final int JAVA_15 = 2;
private static String javaVersion;
private static final float majorJavaVersion = getMajorJavaVersion(System.getProperty("java.specification.version"));
private static int tmpmajor=0;
private static final float DEFAULT_JAVA_VERSION = 1.3f;
static {
javaVersion = System.getProperty("java.version");
if (javaVersion.indexOf("1.4.") != -1) {
tmpmajor = JAVA_14;
}else if (javaVersion.indexOf("1.5.") != -1) {
tmpmajor = JAVA_15;
}
}
private static final float getMajorJavaVersion(String javaVersion) {
try {
return Float.parseFloat(javaVersion.substring(0, 3));
} catch ( NumberFormatException e ){
return DEFAULT_JAVA_VERSION;
}
}
public static boolean isJDK13(){
return majorJavaVersion >= DEFAULT_JAVA_VERSION;
}
public static boolean isJDK14() {
return majorJavaVersion >= 1.4f;
}
public static boolean isJDK15() {
return majorJavaVersion >= 1.5f;
}
public static boolean isSun() {
return System.getProperty("java.vm.vendor").indexOf("Sun") != -1;
}
public static boolean isApple() {
return System.getProperty("java.vm.vendor").indexOf("Apple") != -1;
}
public static String getJavaVersion() {
return javaVersion;
}
public static int getMajorJavaVersion() {
return tmpmajor;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -