'java 시스템환경 읽기'에 해당되는 글 1건

  1. 2010.09.08 JAVA 시스템 환경읽어오기
JAVA2010. 9. 8. 17:56

import java.util.Enumeration;
import java.util.Properties;


public class GetRuntimeInfo {
    private void getRuntimeInformation(){
        Properties properties = null;
       
        try{
            properties = System.getProperties();
        }catch(Exception e){
            e.printStackTrace();
        }
       
        Enumeration en = properties.propertyNames();
        while(en.hasMoreElements()){
            String s = (String)en.nextElement();
            String stringValue = properties.getProperty(s);
            System.out.println(s + " : " + stringValue);           
        }
    }
   
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        new GetRuntimeInfo().getRuntimeInformation();
    }
} 

'JAVA' 카테고리의 다른 글

10진수 2진수,8진수 변환  (0) 2010.09.09
java systeminfo파일로 정보읽기  (0) 2010.09.08
JAVA Generic 예제  (0) 2010.08.12
JAVA 향상된 For문  (0) 2010.08.12
JAVA Generic  (0) 2010.08.12
Posted by 달빛낙엽