Halaman

Subscribe:

Main Menu

Kamis, Mei 01, 2008

Mendapatkan Informasi Sistem dg Java

Terkadang dalam program kita butuh untuk mendapatkan informasi tentang komputer yang kita pakai. misalnya jenis operating system itu. ip addressnya, dll

nah berikut perintah2 sederhana di java itu untuk mendapat informasi sistem :)

Mendapatkan IP Adress
InetAddress.getLocalHost().getHostAddress()
Java Runtime Environment version
System.getProperty("java.version")

Java Runtime Environment vendor
System.getProperty("java.vendor")
Java vendor URL
System.getProperty("java.vendor.url")
Java installation directory
System.getProperty("java.home")

Java Virtual Machine specification version
System.getProperty("java.vm.specification.version")

Java Virtual Machine specification vendor
System.getProperty("java.vm.specification.vendor")

Java Virtual Machine specification name
System.getProperty("java.vm.specification.name")

Java Virtual Machine implementation version
System.getProperty("java.vm.version")

Java Virtual Machine implementation vendor
System.getProperty("java.vm.vendor")

Java Virtual Machine implementation name
System.getProperty("java.vm.name")

Java Runtime Environment specification version
System.getProperty("java.specification.version")

Java Runtime Environment specification vendor
System.getProperty("java.specification.vendor")

Java Runtime Environment specification name
System.getProperty("java.specification.name")

Java class format version number
System.getProperty("java.class.version")

Java class path
System.getProperty("java.class.path")

List of paths to search when loading libraries
System.getProperty("java.library.path")

Default temp file path
System.getProperty("java.io.tmpdir")

Name of JIT compiler to use
System.getProperty("java.compiler")

Path of extension directory or directories
System.getProperty("java.ext.dirs")

Operating System name
System.getProperty("os.name")

Operating System architecture
System.getProperty("os.arch")

Operating System version
System.getProperty("os.version")

File separator ("/" on UNIX)
System.getProperty("file.separator")

Path separator (":" on UNIX)
System.getProperty("path.separator")

Line separator ("\n" on UNIX)
System.getProperty("line.separator")

User's account name
System.getProperty("user.name")

User's home directory
System.getProperty("user.home")

User's current working directory
System.getProperty("user.dir")

Mendapatkan tanggal hari ini

Calendar.getInstance().getTime().getTime())

Dan Lain-Lain :D.

1 komentar:

Anonim mengatakan...

Pak, saya pengen tanya ne, saya baca syntax ky ini:
String indexDir = System.getProperty("index.dir");

Nah yg mo sy tanyakan, index.dir tu apa ya???