" * Hardware Architecture: " + System.getProperty("os.arch") + "\n\n" +
"We are sorry for the trouble and thanks for reporting problems with JabRef!\n";
System.out.println(errorMessage);
JEditorPane pane = new JEditorPane("text/html",
"<html>The following error occurred while running JabRef:<p><font color=\"red\">" +
exceptionToString(e.getCause()).replaceAll("\\n", "<br>") +
"</font></p>" +
"<p>Please first check if this problem and a solution is already known. Find our...</p>" +
"<ul><li>...FAQ at <b>http://jabref.sf.net/faq.php</b> and our..." +
"<li>...user mailing-list at <b>http://sf.net/mailarchive/forum.php?forum_name=jabref-users</b></ul>" +
"If you do not find a solution there, please let us know about the problem by writing a bug report.<br>" +
"You can find our bug tracker at <b>http://sourceforge.net/tracker/?atid=600306&group_id=92314</b>.<br>" +
"<ul><li>If the bug has already been reported there, please add your comments to the existing bug.<br>" +
"<li>If the bug has not been reported yet, then we need the complete error message given above<br>" +
"and a description of what you did before the error occured.</ul>" +
"We also need the following information (you can copy and paste all this):</p>" +
"<ul><li>Java Version: " + javaVersion +
"<li>Java Vendor: " + javaVendor +
"<li>Operating System: " + System.getProperty("os.name") + " (" + System.getProperty("os.version") + ")" +
"<li>Hardware Architecture: " + System.getProperty("os.arch") + "</ul>" +
"We are sorry for the trouble and thanks for reporting problems with JabRef!</html>");
pane.setEditable(false);
pane.setOpaque(false);
pane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
Component componentToDisplay;
if (pane.getPreferredSize().getHeight() > 700){
JScrollPane sPane = new JScrollPane(pane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
sPane.setBorder(BorderFactory.createEmptyBorder());
sPane.setPreferredSize(new Dimension((int)pane.getPreferredSize().getWidth() + 30, 700));
componentToDisplay = sPane;
} else {
componentToDisplay = pane;
}
JOptionPane.showMessageDialog(null, componentToDisplay, "An error occurred while running JabRef", JOptionPane.ERROR_MESSAGE);
} catch (SecurityException e) {
System.out.println("ERROR: You are running JabRef in a sandboxed"
+ " environment that does not allow it to be started.");
e.printStackTrace();
} catch (NoSuchMethodException e) {
System.out
.println("This error should not happen."
+ " Write an email to the JabRef developers and tell them 'NoSuchMethodException in JabRefMain'");
} catch (ClassNotFoundException e) {
System.out
.println("This error should not happen."
+ " Write an email to the JabRef developers and tell them 'ClassNotFoundException in JabRefMain'");
} catch (IllegalArgumentException e) {
System.out
.println("This error should not happen."
+ " Write an email to the JabRef developers and tell them 'IllegalArgumentException in JabRefMain'");
} catch (IllegalAccessException e) {
System.out
.println("This error should not happen."
+ " Write an email to the JabRef developers and tell them 'IllegalAccessException in JabRefMain'");
} catch (UnsupportedClassVersionError e){
String errorMessage =
exceptionToString(e) + "\n" +
"This means that your Java version (" + javaVersion + ") is not high enough to run JabRef.\n" +
"Please update your Java Runtime Environment to a version 1.5 or higher.\n";
System.out.println(errorMessage);
JEditorPane pane = new JEditorPane("text/html",
"<html>You are using Java version " + javaVersion + ", but JabRef needs version 1.5 or higher." +
"<p>Please update your Java Runtime Environment.</p>" +
"<p>For more information visit <b>http://jabref.sf.net/faq.php</b>.</p></html>");
pane.setEditable(false);
pane.setOpaque(false);
pane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
JOptionPane.showMessageDialog(null, pane, "Insufficient Java Version Installed", JOptionPane.ERROR_MESSAGE);
}
}