사용 목적
사용 결과
사용 법
String dir = System.getProperty("user.home");
System.out.println(dir);
// linux == /home/유저명
// macOS == //Users/유저명
import java.util.Iterator;
import java.util.Properties;
public class TEST {
public static void main(String[] args) {
Properties props = System.getProperties();
Iterator<String> iterList = props.stringPropertyNames().iterator();
while(iterList.hasNext()) {
String key = iterList.next();
String value = props.getProperty(key);
System.out.println(key + "=" + value);
}
}
}