我有這個代碼在eclipse中保存和加載屬性文件。我創建了一個eclipse應用程序項目。屬性文件在eclipse中保存在哪裏?
Properties properties = new Properties();
try {
String propertyFilePath = "smcho.properties";
// properties.load(new FileInputStream(propertyFilePath));
properties.setProperty("database", "values");
properties.store(new FileOutputStream(propertyFilePath), null);
// Now, re-read the property file
properties.load(new FileInputStream(propertyFilePath));
System.out.println(properties.getProperty("database"));
} catch (IOException e) {
e.printStackTrace();
}
它工作正常,但我找不到在我的電腦smcho.properties
文件。 當我將文件路徑設置爲絕對路徑時,文件被存儲並從路徑加載。屬性文件在哪裏與屬性文件名一起保存?