gpt4 book ai didi

java - Crawler4j ImageCrawler 字符串参数

转载 作者:行者123 更新时间:2023-12-01 13:48:00 27 4
gpt4 key购买 nike

我正在尝试启动crawler4j示例: crawler4j

当我启动 ImageCrawlController 时,第一步 args.length < 3 就失败了,因为它是 0。我如何确保 args 大于 3?

public class ImageCrawlController {
public static void main(String[] args) throws Exception {
if (args.length < 3) {
System.out.println("Needed parameters: ");
System.out.println("\t rootFolder (it will contain intermediate crawl data)");
System.out.println("\t numberOfCralwers (number of concurrent threads)");
System.out.println("\t storageFolder (a folder for storing downloaded images)");
return;
}
}
}

最佳答案

'... how can I put a value in the main-function for args? The main-function always starts with args = 0.'

在 Eclipse 中:运行 -> 运行配置。在左侧菜单中选择 Java 应用程序。现在选择选项卡:参数。

您可以调用他们:System.out.println(args[1]); ///<-2

add arguments, separate them whitespace

关于java - Crawler4j ImageCrawler 字符串参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20201639/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com