I would like to read a property file, like this:
Properties props = new Properties();
props.load(MajorBot.class.getResourceAsStream("application.properties"));
But when I am trying to do this I get an error:
Exception in thread "main" java.lang.NullPointerException: inStream parameter is null at java.base/java.util.Objects.requireNonNull(Objects.java:246) at java.base/java.util.Properties.load(Properties.java:406) at majorbot.MajorBot.main(MajorBot.java:13)
My app was created using IntelliJ, new Gradle/Java project. After creation, there was a resources
directory allready there. I have created application.properties
there, but I cannod read this file.
Is there a way to fix this?