Crawler4j ImageCrawler String args

时间:2013-11-25 19:33:11

标签: java web-crawler crawler4j

我正在尝试启动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;
    }
  }
}

1 个答案:

答案 0 :(得分:1)

  

'...如何在args的main函数中放置一个值?该   main函数始终以args = 0开头。'

日食:RUN-&gt;运行配置。在左侧菜单中选择Java应用程序。现在选择标签:ARGUMENTS。

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

add arguments, separate them whitespace