NullPointerException when reading a properties file in Java

前端 未结 11 1364
我在风中等你
我在风中等你 2020-12-09 17:05

I am using the following code to read a properties file:

Properties pro = new Properties();
InputStream is = Thread.currentThread().getContextClassLoader().         


        
11条回答
  •  攒了一身酷
    2020-12-09 17:19

    I had this problem with a third-party program and it turned out that I needed to include . in the classpath so that the program could read a local properties file in the current working directory.

提交回复
热议问题