转载:http://blog.csdn.net/anqini/article/details/2501809
System.out.println(System.getProperty("user.dir")); <span style="white-space:pre"> </span>//工程的绝对路径
System.out.println(Thread.currentThread().getContextClassLoader().getResource(""));<span style="white-space:pre"> </span>//当前classpath的uri的
new Properties().load(new FileInputStream("test.properties"));<span style="white-space:pre"> </span>//test文件在工程的根目录下
new Properties().load(new FileInputStream("test/test.properties"));<span style="white-space:pre"> </span>//工程底下的test的文件夹test.properties
ResourceBundle rs = ResourceBundle.getBundle("org.hello");<span style="white-space:pre"> </span>//org<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">包底下有这个文件hello.properties</span>