Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34645
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2016-06-14 13:58 -0700 |
| References | (10 earlier) <njpea7$f9d$1@dont-email.me> <5d5addac-8b3f-4fd0-bf88-257db27ae886@googlegroups.com> <013ff6eb-a7b2-47c6-9613-ed5b5d46ede3@googlegroups.com> <e8d60beb-0f23-4529-9f34-ceca74c41eca@googlegroups.com> <64ad2a5a-de2c-419c-8c99-1964613403e5@googlegroups.com> |
| Message-ID | <e98ea822-3e97-4c56-8d25-420bc2c28cbd@googlegroups.com> (permalink) |
| Subject | Re: Could not find or load main class com.mindprod.ensure.Ensure |
| From | Eric Douglas <e.d.programmer@gmail.com> |
On Tuesday, June 14, 2016 at 4:34:42 PM UTC-4, Lew wrote: > So in other words, they did "just write a method that does nothing but call another method", contradicting what you said in the previous breath and confirming what I said. Thank you for validating my point. No. SwingUtilities.invokeLater() calls the EventQueue.invokeLater(). When they first wrote the SwingUtilities, EventQueue did not exist (Java 1.1?). When they wrote EventQueue they rewrote the SwingUtilities to do nothing but call EventQueue for backwards compatibility only. If you're writing a new API there's no reason to do that. > > So is an exception from main different from System.exit? > > Yes, on the face. > And normally one doesn't call System.exit(), either. Yes, normally. That's the whole point of the discussion. If your main method gets an error it must handle it or crash. It is normal to call System.exit(returncode) to pass a value back to a command interpreter running Java as a background process. It may be called from a batch process where the return code would tell it something useful about the input (wait? try alternate source?) or the output (skip subsequent task? halt production and notify support?). These days we may have fancier ways to start the Java processes that would make use of the thrown exception instead.. > > It depends on the application. Is something calling the main that can handle the exception? > > Rarely, if ever. The purpose of 'main' is to be an entry point (or the entry point), and other uses are contraindicated. So nearly always, the answer is "no", and that's the case to which I'm speaking. > > > Is something running the class that's looking for the exit code? > > If so, then for sure throwing an exception is different. In practice, the answer is nearly always "no", so let's solve for that case. > > > Did we use [sic] to run Java from command [sic] line that checked exit codes and now we have a new method to trap exceptions that is replacing the exit code logic which is slowly becoming obsolete? > > No, we did not and are not. So what are you suggesting? That production code doesn't get errors?
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Could not find or load main class com.mindprod.ensure.Ensure Roedy Green <inquiry@mindprod.com> - 2016-06-13 06:51 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Roedy Green <inquiry@mindprod.com> - 2016-06-13 07:02 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Douglas <e.d.programmer@gmail.com> - 2016-06-13 07:15 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Roedy Green <inquiry@mindprod.com> - 2016-06-13 07:35 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Lew <lewbloch@gmail.com> - 2016-06-13 13:48 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Roedy Green <inquiry@mindprod.com> - 2016-06-13 14:11 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-13 20:54 -0400
Re: Could not find or load main class com.mindprod.ensure.Ensure Arne Vajhøj <arne@vajhoej.dk> - 2016-06-13 21:57 -0400
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-13 22:58 -0400
Re: Could not find or load main class com.mindprod.ensure.Ensure Martin Gregorie <martin@address-in-sig.invalid> - 2016-06-14 10:33 +0000
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Douglas <e.d.programmer@gmail.com> - 2016-06-14 04:59 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Martin Gregorie <martin@address-in-sig.invalid> - 2016-06-14 15:11 +0000
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-14 11:31 -0400
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Douglas <e.d.programmer@gmail.com> - 2016-06-14 09:00 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-14 13:18 -0400
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Douglas <e.d.programmer@gmail.com> - 2016-06-14 10:38 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Lew <lewbloch@gmail.com> - 2016-06-14 12:55 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Douglas <e.d.programmer@gmail.com> - 2016-06-14 13:14 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Lew <lewbloch@gmail.com> - 2016-06-14 13:34 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Douglas <e.d.programmer@gmail.com> - 2016-06-14 13:58 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Lew <lewbloch@gmail.com> - 2016-06-14 12:52 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Stanimir Stamenkov <s7an10@netscape.net> - 2016-06-15 02:46 +0300
Re: Could not find or load main class com.mindprod.ensure.Ensure Lew <lewbloch@gmail.com> - 2016-06-15 12:22 -0700
Re: Could not find or load main class com.mindprod.ensure.Ensure Martin Gregorie <martin@address-in-sig.invalid> - 2016-06-16 01:17 +0000
Re: Could not find or load main class com.mindprod.ensure.Ensure Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-15 21:56 -0400
Re: Could not find or load main class com.mindprod.ensure.Ensure Martin Gregorie <martin@address-in-sig.invalid> - 2016-06-16 11:01 +0000
csiph-web