I have a multi-threaded Java application. I want the whole application to fail is one of the thread encounters any exception.
I don’t think doing System.exit(); inside the thread will exit the whole app.
Can someone suggest a way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
put
try-catchin Thread’s run method and in catch blockSystem.exit(0);it works.