I am trying the try with resource statement:
try(ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream(defaultFile)))
{
;
}
catch(IOException e)
{
;
}
But I get syntax error, which makes me think that I need the newest version of Java. So I have downloaded the latest Jre and Jdk from Oracle site, but I don't know how to effectively substitute the new Jre and Jdk with the older ones. I have tried from eclipse windows->preferences->installed JREs, the is the option "search".But If I try searching in the directory where I have Jre and Jdk files, it says that no valid Jre was found. How to effectively update Jre and Jdk? PS:I am on ubuntu 10.10