I am using a jar file from other person, but I need to add the source codes into my project and compile them when I import such packages. The issue is this jar file seems to generated by java1.7
so it uses some java1.7
fetures. But I am using java1.6
. For this source codes:
public Properties getDefaults() {
try (InputStream stream
= getClass().getResourceAsStream(PROPERTY_FILE)) {
Properties properties = new Properties();
properties.load(stream);
return properties;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
The eclipse gives such error hints:
Resource specification not allowed here for source level below 1.7
Then how could I rewrite such codes so that it can be handled by java1.6
?