Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 没有Eclipse,程序工作不正确_Java_Eclipse_Build_Libraries - Fatal编程技术网

Java 没有Eclipse,程序工作不正确

Java 没有Eclipse,程序工作不正确,java,eclipse,build,libraries,Java,Eclipse,Build,Libraries,我没有任何关于本地文件系统的参考资料。当我用Eclipse启动程序时,它工作正常。但当我将其导出为可运行的jar文件时,我的程序正常启动,在一段时间内工作一个周期,只是不进入第二次。我的意思是没有退出while循环。它只是进入循环的末尾,不再进入 也没有例外。似乎只有一家图书馆拒绝履行自己的职责。此外,我在不同的文件夹中拥有所有库,但正如我所知,在编译时,所有库都会导出到project中。有什么想法吗 do { //messaging, that it still works. Second t

我没有任何关于本地文件系统的参考资料。当我用Eclipse启动程序时,它工作正常。但当我将其导出为可运行的jar文件时,我的程序正常启动,在一段时间内工作一个周期,只是不进入第二次。我的意思是没有退出while循环。它只是进入循环的末尾,不再进入

也没有例外。似乎只有一家图书馆拒绝履行自己的职责。此外,我在不同的文件夹中拥有所有库,但正如我所知,在编译时,所有库都会导出到project中。有什么想法吗

do {
//messaging, that it still works. Second time it even doesn't get there
            threadController.log("Working");
            link = null;
            try {
                currentProxy = threadController.getProxy();
                link = threadController.getPageLink(currentProxy);
                HashMap<String, String> map = null;
                map = parser.loadFullInfo(currentProxy, link);
                if (map != null) {
                    threadController.addMap(map);
                    threadController.incLinksProcessed();
                    Thread.sleep(threadController.getRequestTimeout());
                }
            } catch (MalformedURLException e) {
                threadController.log(e.toString());
            } catch (BadProxyException e) {
                threadController.log(e.toString());
                if (link == null) {
                    link = "";
                } else {
                    threadController.addLinkBack(link);
                }
            } catch (InvalidLinkFormatException e) {
                threadController.log(e.toString());
                ThreadController.showInfoDialog("Ошибка", "Плохая ссылка в списке");
                link = "";
            } catch (IOException e) {
                threadController.log(e.toString());
                if (link != null) {
                    threadController.addLinkBack(link);
                } else
                    link = "";
            } catch (NoProxiesException e) {
                threadController.log(e.toString());
                ThreadController.showInfoDialog("Ошибка", "В указанных файлах отсутсвуют прокси");
                link = null;
            } catch (CaptchaException e) {
                threadController.log(e.toString());
                if (link == null) {
                    link = "";
                } else {
                    threadController.addLinkBack(link);
                }
                if (currentProxy.getProxy() == Proxy.NO_PROXY) {
                    threadController.log("Превышен лимит запросов для вашего ip адреса. Идет запрос капчи. Начните использовать прокси");
                } else {
                    threadController.log("Превышет лимит запросов для прокси: " + currentProxy.getProxy().toString() + ". Идет запрос капчи. Обновите список прокси.");
                }

            } catch (InterruptedException e) {
                threadController.log(e.toString());
                if (link != null) {
                    try {
                        threadController.addLinkBack(link);
                    } catch (Exception e1) {
                        threadController.log(e.toString());
                        e1.printStackTrace();
                    }
                }
            } catch (TooMuchWaitException e) {
                threadController.log(e.toString());
                link = "";
            } catch (Exception e) {
                threadController.log(e.toString());
                //there works finally block and then it doesn't enter in cycle again, though it doesn't quit out of it (I printed my two conditions in "while" every cycle). It just stays like there occured some error or smth.
            } finally {
                threadController.log("I'm alive");
            }
        } while (link != null && !threadController.isStopped());

如果没有任何代码片段,绝对不可能帮助您。库罢工了吗?该死!图书馆工会!添加了一些代码。也许这会有帮助:你试过调试你的代码吗?使用远程调试器或添加打印语句检查程序退出循环的原因。可能有两个原因:link==null或threadController.isStopped==true。链接可以为null,例如,如果抛出了MalformedUrlException或InterruptedException。我打印了语句。我做了所有事情:在检查之前,我经常显示link==null和threadController.isStopped的布尔状态。问题是,正如我在第一篇文章中所写,它并没有退出周期。它只是不想第二次进入。