Java – class.getResource returns null

For those who use Intellij Idea: check for Settings > Build, Execution, Deployment > Compiler > Resource patterns.

The setting contains all extensions that should be interpreted as resources. If an extension does not comply to any pattern here, class.getResource will return null for resources using this extension.

Leave a Comment