import java.util.*; import java.io.*; public class HelloWorldSetSystemProperties { public static void main(String[] args) { try { // FileInputStreamオブジェクトを生成 FileInputStream propFile = new FileInputStream("HelloWorldSystemProperty.properties"); // 現在のシステムプロパティのリストを取得します Properties props = new Properties(System.getProperties()); // 入力ストリームからプロパティのリストを読み込みます props.load(propFile); // システムプロパティの全リストを設定します System.setProperties(props); // システムプロパティの全リストを表示します System.getProperties().list(System.out); } catch (Exception e) { e.printStackTrace(); } } }