「java」System.getPropertyの使い方

1.javaコード
import java.util.Properties;
public class Jattinfo {

public static void main(String[] args) {
/*System.getenv(“PATH");
System.getenv(“JAVA_HOME");*/
System.getProperty(“pencil color");

System.getProperty(“java.specification.version");
Properties p = System.getProperties();
p.list(System.out);

}

}

2.結果
— listing properties —
java.runtime.name=Java(TM) SE Runtime Environment
sun.boot.library.path=C:\pleiades\pleiades\eclipse\jre\jre\bin
java.vm.version=25.60-b23
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=;
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
file.encoding.pkg=sun.io
user.script=
user.country=JP
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=Service Pack 1
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\pleiades\pleiades\workspace\kak222
java.runtime.version=1.8.0_60-b27
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\pleiades\pleiades\eclipse\jre\jre\…
os.arch=amd64
java.io.tmpdir=C:\Users\tom\AppData\Local\Temp\
line.separator=

java.vm.specification.vendor=Oracle Corporation
user.variant=
os.name=Windows 7
sun.jnu.encoding=MS932
java.library.path=C:\pleiades\pleiades\eclipse\jre\bin;…
java.specification.name=Java Platform API Specification
java.class.version=52.0
sun.management.compiler=HotSpot 64-Bit Tiered Compilers
os.version=6.1
user.home=C:\Users\tom
user.timezone=
java.awt.printerjob=sun.awt.windows.WPrinterJob
file.encoding=UTF-8
java.specification.version=1.8
user.name=tom
java.class.path=C:\pleiades\pleiades\workspace\kak222…
java.vm.specification.version=1.8
sun.arch.data.model=64
java.home=C:\pleiades\pleiades\eclipse\jre\jre
sun.java.command=kak222.Jattinfo
java.specification.vendor=Oracle Corporation
user.language=ja
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode
java.version=1.8.0_60
java.ext.dirs=C:\pleiades\pleiades\eclipse\jre\jre\…
sun.boot.class.path=C:\pleiades\pleiades\eclipse\jre\jre\…
java.vendor=Oracle Corporation
file.separator=\
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
sun.desktop=windows
sun.cpu.isalist=amd64

Java

Posted by arkgame