简体   繁体   English

如何将外部库与原子包和Java脚本一起使用?

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

How do I go about configuring the classpath when using the scripts package with atom/java? 在atom / java中使用脚本包时,如何配置类路径?

I know my classpath is: 我知道我的课程路径是:

usr/local/algs4/algs4.jar USR /本地/ algs4 / algs4.jar

Here is the code I am testing with: 这是我正在测试的代码:

import edu.princeton.cs.algs4.*; 导入edu.princeton.cs.algs4。*;

public class Wget { 公共课程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();
}

} }

Since you're using algs4, Use Princeton's site and search for classpath. 由于您使用的是algs4,请使用Princeton的网站并搜索classpath。 http://algs4.cs.princeton.edu/code/ http://algs4.cs.princeton.edu/code/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM