Prevent application from exiting while running as a jar