Java by API/org.apache.commons.lang/SystemUtils — различия между версиями

Материал из Java эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 14:47, 31 мая 2010

SystemUtils.FILE_SEPARATOR

/*
1) FILE_SEPARATOR =\
2) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
3) JAVA_HOME =C:\Java_Dev\sdk\jdk\jre
4) Is 1.3 + =true
5) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
6) JAVA_VENDOR =Sun Microsystems Inc.
7) OS_NAME =Windows XP
 */
import org.apache.rumons.lang.SystemUtils;
public class SystemUtilsTrial {
    public static void main(String[] args) {
        System.out.println("1) FILE_SEPARATOR =" + SystemUtils.FILE_SEPARATOR);
        System.out.println("2) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("3) JAVA_HOME =" + SystemUtils.JAVA_HOME);
        System.out.println("4) Is 1.3 + =" +
            SystemUtils.isJavaVersionAtLeast(1.3f));
        System.out.println("5) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("6) JAVA_VENDOR =" + SystemUtils.JAVA_VENDOR);
        System.out.println("7) OS_NAME =" + SystemUtils.OS_NAME);
    }
}





SystemUtils.isJavaVersionAtLeast(1.3f)

/*
1) FILE_SEPARATOR =\
2) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
3) JAVA_HOME =C:\Java_Dev\sdk\jdk\jre
4) Is 1.3 + =true
5) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
6) JAVA_VENDOR =Sun Microsystems Inc.
7) OS_NAME =Windows XP
 */
import org.apache.rumons.lang.SystemUtils;
public class SystemUtilsTrial {
    public static void main(String[] args) {
        System.out.println("1) FILE_SEPARATOR =" + SystemUtils.FILE_SEPARATOR);
        System.out.println("2) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("3) JAVA_HOME =" + SystemUtils.JAVA_HOME);
        System.out.println("4) Is 1.3 + =" +
            SystemUtils.isJavaVersionAtLeast(1.3f));
        System.out.println("5) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("6) JAVA_VENDOR =" + SystemUtils.JAVA_VENDOR);
        System.out.println("7) OS_NAME =" + SystemUtils.OS_NAME);
    }
}





SystemUtils.JAVA_EXT_DIRS

/*
1) FILE_SEPARATOR =\
2) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
3) JAVA_HOME =C:\Java_Dev\sdk\jdk\jre
4) Is 1.3 + =true
5) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
6) JAVA_VENDOR =Sun Microsystems Inc.
7) OS_NAME =Windows XP
 */
import org.apache.rumons.lang.SystemUtils;
public class SystemUtilsTrial {
    public static void main(String[] args) {
        System.out.println("1) FILE_SEPARATOR =" + SystemUtils.FILE_SEPARATOR);
        System.out.println("2) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("3) JAVA_HOME =" + SystemUtils.JAVA_HOME);
        System.out.println("4) Is 1.3 + =" +
            SystemUtils.isJavaVersionAtLeast(1.3f));
        System.out.println("5) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("6) JAVA_VENDOR =" + SystemUtils.JAVA_VENDOR);
        System.out.println("7) OS_NAME =" + SystemUtils.OS_NAME);
    }
}





SystemUtils.JAVA_HOME

/*
1) FILE_SEPARATOR =\
2) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
3) JAVA_HOME =C:\Java_Dev\sdk\jdk\jre
4) Is 1.3 + =true
5) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
6) JAVA_VENDOR =Sun Microsystems Inc.
7) OS_NAME =Windows XP
 */
import org.apache.rumons.lang.SystemUtils;
public class SystemUtilsTrial {
    public static void main(String[] args) {
        System.out.println("1) FILE_SEPARATOR =" + SystemUtils.FILE_SEPARATOR);
        System.out.println("2) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("3) JAVA_HOME =" + SystemUtils.JAVA_HOME);
        System.out.println("4) Is 1.3 + =" +
            SystemUtils.isJavaVersionAtLeast(1.3f));
        System.out.println("5) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("6) JAVA_VENDOR =" + SystemUtils.JAVA_VENDOR);
        System.out.println("7) OS_NAME =" + SystemUtils.OS_NAME);
    }
}





SystemUtils.JAVA_VENDOR

/*
1) FILE_SEPARATOR =\
2) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
3) JAVA_HOME =C:\Java_Dev\sdk\jdk\jre
4) Is 1.3 + =true
5) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
6) JAVA_VENDOR =Sun Microsystems Inc.
7) OS_NAME =Windows XP
 */
import org.apache.rumons.lang.SystemUtils;
public class SystemUtilsTrial {
    public static void main(String[] args) {
        System.out.println("1) FILE_SEPARATOR =" + SystemUtils.FILE_SEPARATOR);
        System.out.println("2) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("3) JAVA_HOME =" + SystemUtils.JAVA_HOME);
        System.out.println("4) Is 1.3 + =" +
            SystemUtils.isJavaVersionAtLeast(1.3f));
        System.out.println("5) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("6) JAVA_VENDOR =" + SystemUtils.JAVA_VENDOR);
        System.out.println("7) OS_NAME =" + SystemUtils.OS_NAME);
    }
}





SystemUtils.OS_NAME

/*
1) FILE_SEPARATOR =\
2) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
3) JAVA_HOME =C:\Java_Dev\sdk\jdk\jre
4) Is 1.3 + =true
5) JAVA_EXT_DIRS =C:\Java_Dev\sdk\jdk\jre\lib\ext
6) JAVA_VENDOR =Sun Microsystems Inc.
7) OS_NAME =Windows XP
 */
import org.apache.rumons.lang.SystemUtils;
public class SystemUtilsTrial {
    public static void main(String[] args) {
        System.out.println("1) FILE_SEPARATOR =" + SystemUtils.FILE_SEPARATOR);
        System.out.println("2) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("3) JAVA_HOME =" + SystemUtils.JAVA_HOME);
        System.out.println("4) Is 1.3 + =" +
            SystemUtils.isJavaVersionAtLeast(1.3f));
        System.out.println("5) JAVA_EXT_DIRS =" + SystemUtils.JAVA_EXT_DIRS);
        System.out.println("6) JAVA_VENDOR =" + SystemUtils.JAVA_VENDOR);
        System.out.println("7) OS_NAME =" + SystemUtils.OS_NAME);
    }
}