use absolute path to reference a json file in resources folder java code example
Example 1: java resource file
File file = new File(
getClass().getClassLoader().getResource("database.properties").getFile()
);
Example 2: java resource file
InputStream inputStream = getClass()
.getClassLoader().getResourceAsStream("database.properties");