java属性错误_在java中读取属性文件时发生文件未找到错误
生活随笔
收集整理的這篇文章主要介紹了
java属性错误_在java中读取属性文件时发生文件未找到错误
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我在resources / common / configure /包下創(chuàng)建屬性文件
然后我創(chuàng)建代碼
Properties prop = new Properties();
try {
//load a properties file
prop.load(new FileInputStream("resources/common/configure/commonData.properties"));
//get the property value and print it out
System.out.println(prop.getProperty("id"));
} catch (IOException ex) {
ex.printStackTrace();
}
但我得到以下錯誤
java.io.FileNotFoundException: (The system cannot find the path specified)
請讓我知道如何獲得此屬性文件.
總結
以上是生活随笔為你收集整理的java属性错误_在java中读取属性文件时发生文件未找到错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql5.1.7升级到5.6_1 M
- 下一篇: mysql建立索引 有什么缺陷_MySQ