java - How to make runnable Jar programs that do not fail silently? -


To create, I can read the unmatched exception if I run it from the command prompt ( java -jar Myprogram.jar ).

Example code:

  Public static zero main (string rule []) {try {EntireProgram ()}} Catch (throttle T) {new error ("somehow There are errors in our error handling code "); }} Public static zero EntireProgram () {System.out.println (1/0); }   

Command line output:

Enter image details However, if I run the jar program <strong> double-clicking it </ strong> (most end-users expect), then unconstitutional exception remains <em> quiet </ em>. I have noticed that this

 Enter image details here

Enter image details here enter image details here

unread exceptions The advantage of handling this method is that the user address something went wrong (and maybe report it, hopefully).

How do I uncheck the unused exceptions of my program in this way Can I be handled?

Why not add a line like this in your catch block, which will show you how you run your app, even though error message.

  javax.swing.JOptionPane.showMessageDialog (empty, "some In fact, it is wrong .. you should inform. ");    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -