Questions tagged [system.exit]
The system.exit tag has no usage guidance.
system.exit
74
questions
-1
votes
0
answers
43
views
Java exit status codes based on application warnings vs errors [closed]
I'm developing a Java application where the exit status codes need to reflect the following conditions:
Exit with status code 0 if no errors or warnings occur during execution.
Exit with status code ...
0
votes
0
answers
7
views
What should i write inside JOptionPane.YES_NO_OPTION
so everytime i close my program obviously a window pops up asking if i want to close the app
but im not sure what im suppose to write inside if NO is chosen.
right now everytime i press no the GUI ...
0
votes
0
answers
147
views
How to terminate springboot application programmatically on cloud foundry?
I need to terminate a springboot function programmatically with something like System.exit(-1); when running.
When I ran the app on my laptop, it could terminate at where I put "System.exit(-1);&...
4
votes
3
answers
853
views
Exit Android application from application class (Not activity)
Is there a way to exit android application from the Application class itself.
This is even before any activity has been initialized.
Scenario is user side-loading the build in an unsupported device ...
1
vote
1
answer
351
views
How to write a test case method having System.exit() using Junit 5?
Scenario: Below negative scenario to be tested during Integration test. currently the test case getting failed due exit and not reaching to the test method.
example :
private void method1(int a){
try{
...
0
votes
1
answer
86
views
Android: Stopping java main method without closing the activity
For Android, I have programmed an App in which a String is given and it is cut into smaller Strings and saved in a String array always after a hyphen.
This only happens once a button is pressed and ...
1
vote
1
answer
1k
views
Error Message with System.err.println() before System.exit(-1) in Java
I have a problem with crashed Java Virtual Mashines without error message. I often do some checks in my code. Something went wrong, if one of these checks will not be fulfilled and the java program ...
2
votes
1
answer
2k
views
Java Security class to prevent you from terminating the code using exit(0)! in HackerRank
Can anyone explain this code of HackerRank?
class DoNotTerminate {
public static class ExitTrappedException extends SecurityException {
private static final long serialVersionUID = 1;
...
0
votes
1
answer
145
views
Android: Can't call finish()
Why can't I call finish() in the code below?
I also can't start any Intent.
This is my code:
public class EditProfilePresenter<V extends EditProfileView> extends PickImagePresenter<V> {
...
2
votes
2
answers
426
views
Testing if a java program calls System.exist - without exiting Junit
I am trying to test a file processing program with Junit. In some cases, the program should print an error and finish its run. However, using "System.exit(-1)" causes the program to exit the entire ...
1
vote
0
answers
1k
views
Android - System.exit(0) and restart activity and service
I'm making an Android app, and I need to completely restart the app in a moment. So, to do that, the only solution that has worked (and that I can remember) is to use System.exit(0). I have no idea ...
0
votes
1
answer
505
views
How to Exit an application when my app consists of multiple activities? [duplicate]
How to exit application in android when I have multiple activities in that app?
I have tried finish() and System.exit(0), but none of them worked. What it does is just go to the previous activity.
...
1
vote
0
answers
53
views
KeyListener should work and then quit the program but it doesn't(AutoClicker)
I've made an AutoClicker and it works fine, but I wanted to add a KeyListener so that the person who's using it can stop the autoclicker it should work with the button q but it doesn't!
Here is the ...
2
votes
2
answers
548
views
Confirm program quit when cmd + Q is pressed
I have a program with a JFrame that I use a WindowListener to close the program with. I use the following method to prompt a message about saving changes made in the program:
public void ...
0
votes
1
answer
434
views
Can I exit my android app with code when it is started from a deeplink?
I am building an app which uses either some activities in which the user can navigate or uses one specific activity which starts the app when a deeplink is used. In this DeeplinkActivity I have a ...