Using try-with-resources with run command