You're not dealing with IOException. You need to either catch it or throw it explicitly.
try{
// Your code
}catch(IOException e){
// Deal with IOException
}
or
public static void main(String[] args) throws IOException{
// Your code
}
This is all a consequence of Java having checked exceptions, of which IOException is one.
For your purposes, the second is probably fine since an IO failure can't really be recovered from. In larger programs, you'll almost certainly want to recover from transient IO failures and thus the first would be more appropriate.