=================================
=================================
=================================
/*
1 java.version The version of Java Runtime Environment.
2 java.vendor The name of Java Runtime Environment vendor
3 java.vendor.url The URL of Java vendor
4 java.home The directory of Java installation
5 java.vm.specification.version The specification version of Java Virtual Machine
6 java.vm.specification.vendor The name of specification vendor of Java Virtual Machine
7 java.vm.specification.name Java Virtual Machine specification name
8 java.vm.version JVM implementation version
9 java.vm.vendor JVM implementation vendor
10 java.vm.name JVM implementation name
11 java.specification.version The name of specification version Java Runtime Environment
12 java.specification.vendor JRE specification vendor
13 java.specification.name JREspecification name
14 java.class.version Java class format version number
15 java.class.path Path of java class
16 java.library.path List of paths to search when loading libraries
17 java.io.tmpdir The path of temp file
18 java.compiler The Name of JIT compiler to use
19 java.ext.dirs The path of extension directory or directories
20 os.name The name of OS name
21 os.arch The OS architecture
22 os.version The version of OS
23 file.separator The File separator
24 path.separator The path separator
25 line.separator The line separator
26 user.name The name of account name user
27 user.home The home directory of user
28 user.dir The current working directory of the user
*/
import java.io.File;
public class OpertingSystemInfo
{
public static void main(String[] args)
{
System.out.println("\n The information about OS");
System.out.println("java.version : " + System.getProperty("java.version" ));
System.out.println("java.vendor : " + System.getProperty("java.vendor" ));
System.out.println("java.vendor.url : " + System.getProperty("java.vendor.url" ));
System.out.println("java.home : " + System.getProperty("java.home" ));
System.out.println("java.vm.specification.version: " + System.getProperty("java.vm.specification.version"));
System.out.println("java.vm.specification.vendor : " + System.getProperty("java.vm.specification.vendor" ));
System.out.println("java.vm.specification.name : " + System.getProperty("java.vm.specification.name" ));
System.out.println("java.vm.version : " + System.getProperty("java.vm.version" ));
System.out.println("java.vm.vendor : " + System.getProperty("java.vm.vendor" ));
System.out.println("java.vm.name : " + System.getProperty("java.vm.name" ));
System.out.println("java.specification.version : " + System.getProperty("java.specification.version" ));
System.out.println("java.specification.vendor : " + System.getProperty("java.specification.vendor" ));
System.out.println("java.specification.name : " + System.getProperty("java.specification.name" ));
System.out.println("java.class.version : " + System.getProperty("java.class.version" ));
System.out.println("java.class.path : " + System.getProperty("java.class.path" ));
System.out.println("java.library.path : " + System.getProperty("java.library.path" ));
System.out.println("java.io.tmpdir : " + System.getProperty("java.io.tmpdir" ));
System.out.println("java.compiler : " + System.getProperty("java.compiler" ));
System.out.println("java.ext.dirs : " + System.getProperty("java.ext.dirs" ));
System.out.println("os.name : " + System.getProperty("os.name" ));
System.out.println("os.arch : " + System.getProperty("os.arch" ));
System.out.println("os.version : " + System.getProperty("os.version" ));
System.out.println("file.separator : " + System.getProperty("file.separator" ));
System.out.println("path.separator : " + System.getProperty("path.separator" ));
System.out.println("line.separator : " + System.getProperty("line.separator" ));
System.out.println("user.name : " + System.getProperty("user.name" ));
System.out.println("user.home : " + System.getProperty("user.home" ));
System.out.println("user.dir : " + System.getProperty("user.dir" ));
/* Total number of processors or cores available to the JVM */
System.out.println("Available processors (cores): " +
Runtime.getRuntime().availableProcessors());
/* Total amount of free memory available to the JVM */
System.out.println("Free memory (bytes): " +
Runtime.getRuntime().freeMemory());
/* This will return Long.MAX_VALUE if there is no preset limit */
long maxMemory = Runtime.getRuntime().maxMemory();
/* Maximum amount of memory the JVM will attempt to use */
System.out.println("Maximum memory (bytes): " +
(maxMemory == Long.MAX_VALUE ? "no limit" : maxMemory));
/* Total memory currently in use by the JVM */
System.out.println("Total memory (bytes): " +
Runtime.getRuntime().totalMemory());
/* Get a list of all filesystem roots on this system */
File[] roots = File.listRoots();
/* For each filesystem root, print some info */
//for (File root : roots) {
for (int i=0; i<roots.length ; i++) {
File root = roots[i];
System.out.println("File system root: " + root.getAbsolutePath());
System.out.println("Total space (bytes): " + root.getTotalSpace());
System.out.println("Free space (bytes): " + root.getFreeSpace());
System.out.println("Usable space (bytes): " + root.getUsableSpace());
}
}
}
D:\work>java OpertingSystemInfo
The information about OS
java.version : 1.6.0_11
java.vendor : Sun Microsystems Inc.
java.vendor.url : http://java.sun.com/
java.home : C:\Program Files\Java\jre6
java.vm.specification.version: 1.0
java.vm.specification.vendor : Sun Microsystems Inc.
java.vm.specification.name : Java Virtual Machine Specification
java.vm.version : 11.0-b16
java.vm.vendor : Sun Microsystems Inc.
java.vm.name : Java HotSpot(TM) Client VM
java.specification.version : 1.6
java.specification.vendor : Sun Microsystems Inc.
java.specification.name : Java Platform API Specification
java.class.version : 50.0
java.class.path : .;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1\IBM\SQLLIB\java\db2jcc.jar;C:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip;C
:\PROGRA~1\IBM\SQLLIB\java\db2jcc_license_cisuz.jar;C:\PROGRA~1\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\PROGRA~1\IBM\SQLLIB\bin;C:\PROGRA~1\IBM\SQLLI
B\tools\db2XTrigger.jar;C:\PROGRA~1\IBM\SQLLIB\java\common.jar
java.library.path : C:\WINDOWS\system32;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\
System32\Wbem;C:\app\myeonggyu\product\11.1.0\db_1\bin;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;
C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.1\bin;D:\util\MinGW\bin;C:\Program Files\hercules\hercules
-3.05;C:\Program Files\Java\jdk1.6.0_11\bin;C:\Program Files\IDM Computer Solutions\UltraEdit\
java.io.tmpdir : d:\temp\
java.compiler : null
java.ext.dirs : C:\Program Files\Java\jre6\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
os.name : Windows XP
os.arch : x86
os.version : 5.1
file.separator : \
path.separator : ;
line.separator :
user.name : 강명규
user.home : C:\Documents and Settings\강명규
user.dir : D:\work
Available processors (cores): 2
Free memory (bytes): 4918680
Maximum memory (bytes): 66650112
Total memory (bytes): 5177344
File system root: A:\
Total space (bytes): 0
Free space (bytes): 0
Usable space (bytes): 0
File system root: C:\
Total space (bytes): 104858337280
Free space (bytes): 15995080704
Usable space (bytes): 15995080704
File system root: D:\
Total space (bytes): 395248136192
Free space (bytes): 59337986048
Usable space (bytes): 59337986048
File system root: E:\
Total space (bytes): 0
Free space (bytes): 0
Usable space (bytes): 0
File system root: F:\
Total space (bytes): 184762368
Free space (bytes): 0
Usable space (bytes): 0
D:\work>
=================================
=================================
=================================
'JAVA' 카테고리의 다른 글
[java] 자바 스윙 타이머 (0) | 2011.09.29 |
---|---|
자바 이클립스 한글 패치 방법 관련 (0) | 2011.08.12 |
자바 파일 FILE IO 읽기 쓰기 (0) | 2011.04.13 |
자바 외부 라이브러리를 포함한 JAR파일 만들기 (0) | 2011.04.11 |
부모창에서 자식창의 로드가 완료된 후 함수 호출하기 (0) | 2011.04.01 |