I have an application that was working with Java 1.8.0 162 and I'm in the process of upgrading it to Java 10. One of the issues I'm having is that
appProperties.getClass().getResourceAsStream("/application.properties")
started returning null in Java 10. Any ideas why? appProperties
is defined like this:
appProperties = new Properties();
and this happens in a static method, in case that's relevant.
The file is present in src/main/resources/application.properties
. This happens whether I'm running in from IntelliJ or from the jar produced by Maven.
I tried adding:
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
to my pom.xml
but that had no effect.
Printing the class path with:
System.getProperty("java.class.path")
yields, as the first entry:
C:\Users\pupeno\Documents\Dashman\code\dashman\target\classes
which contains application.properties.