我有一个特性在位置文件(从NetBeans项目资源管理器)找不到属性文件 - 如何找到它作为资源?
-MyTest
+Web Pages
+Source Packages
-Test Packages
-<default package>
+Env.properties <---- Here it is
+com.mycomp.gts.test
+com.mycomp.gts.logintest
.....
....
现在,当我试图使用代码
InputStream propertiesInputStream = getClass().getResourceAsStream("Env.properties");
ENV.load(propertiesInputStream);
它扔java.lang.NullPointerException
此答案可能有助于您的情况:http://stackoverflow.com/a/8854824/122442 – 2013-04-09 06:34:33