0

I´m trying to start the crawler4j example of: crawler4j

When I start the ImageCrawlController I allready fail by the first step args.length < 3, because its 0. How can I make sure, that args is bigger then 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;
    }
  }
}
4

1 回答 1

1

'...我怎样才能在 args 的主函数中输入一个值?主函数始终以 args = 0 开头。

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

你可以打电话给他们:System.out.println(args[1]); ///<-2

添加参数,将它们分隔为空格

于 2013-11-25T20:57:52.680 回答