I am currently trying to read my configuration file from the project root directory to make this actual configuration, I want to move it to an external location and then read from there.
Adding the full path to the following code throws an error:
package CopyEJ; import java.util.Properties; public class Config { Properties configFile; public Config() { configFile = new java.util.Properties(); try {
Here's the error:
java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java:365) at java.util.Properties.load(Properties.java:293) at CopyEJ.Config.<init>(Config.java:13) at CopyEJ.CopyEJ.main(CopyEJ.java:22) Exception in thread "main" java.lang.NullPointerException at java.io.File.<init>(File.java:194) at CopyEJ.CopyEJ.main(CopyEJ.java:48)
How can i fix this?
source share