Java 中解决异常报错的好办法

    public static void main(String[] args) throws IOException {
        try {
            int i = 10 / 0; // 比如这里报错了...但是又不知道为什么报错
        } catch (Exception exception) {
            new ProcessBuilder("C:/Program Files/Internet Explorer/iexplore.exe",
                    "https://www.baidu.com/s?wd=" + exception).start();
        }
    }

自动打开 IE 浏览器,并搜索报错信息

原文地址:https://www.cnblogs.com/Haidnor/p/13729661.html