I am writing serialization code for eclipse I am trying to use FileOutputStream with try-with-resource but I am getting a error message : "Resource specification not allowed here for source level below 1.7" And as fix Eclipse is showing the message "Change project compliance and JRE to 1.7". This is a new error for me, please help.
public static void main(String[] args) {
Employee employeeOut = null;
try(FileOutputStream fos = new FileOutputStream("Employee.ser");
ObjectOutputStream oos = new ObjectOutputStream(fos) ){
}
}
I want to compile this class.