Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Using System.exit(0)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it normal when using the following:

System.exit(0);

That the following info box appears:



I'm using Dr Java.

Thanks in advance.
error.PNG
[Thumbnail for error.PNG]
 
lowercase baba
Posts: 13075
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have no idea what DrJava is. What happens when you run it by hand?
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Adrian Martin wrote:Is it normal when using the following:

System.exit(0);



I don't know what context you're seeing that in, so I don't know what's normal there when using System.exit(). With normal command line execution, you wouldn't see anything like that.

What's more normal, however, is to just not use System.exit() at all.
 
Marshal
Posts: 27379
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It certainly looks to me like that dialog box was designed to appear when System.exit was run. After all, that's what it says.

So without any experience with the product in question, but just based on my experience with how applications are typically designed, I would say yes, that dialog box is designed to pop up under the circumstances it says it's popping up for.

And I see it has a checkbox where you can ask not to see it again. I would check that checkbox if I was the one presented with the dialog.
 
Paul Clapham
Marshal
Posts: 27379
88
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, before telling the dialog to not bother me any more, I would first experiment to see what happened with System.exit(n) for non-zero values of n.
 
Paul Clapham
Marshal
Posts: 27379
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch!
 
Adrian Martin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone. To me it looks like it is doing what it should as the console messages are correct. Just don't like that message and it also clears the interactions dialog/information in DrJava to 'Welcome to DrJava. Working directory is C:\Users\xxxxxx'

I tried to change to System.exit(1) and the same thing happens. I've checked the box so it will not show again. Thanks Paul.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic