簡體   English   中英

如何將外部庫與原子包和Java腳本一起使用?

[英]How can I use external libraries with the scripts atom package and java?

在atom / java中使用腳本包時,如何配置類路徑?

我知道我的課程路徑是:

USR /本地/ algs4 / algs4.jar

這是我正在測試的代碼:

導入edu.princeton.cs.algs4。*;

公共課程Wget {

public static void main(String[] args) {

    // read in data from URL
    String url = args[0];
    In in = new In(url);
    String data = in.readAll();

    // write data to a file
    String filename = url.substring(url.lastIndexOf('/') + 1);
    Out out = new Out(filename);
    out.println(data);
    out.close();
}

}

由於您使用的是algs4,請使用Princeton的網站並搜索classpath。 http://algs4.cs.princeton.edu/code/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM