Properly close jvm