[英]How can I install additional packages in Java?
我对 Java 很陌生。 我想使用 package 中的一些功能,称为daj
教程代码有以下几行。
import daj.*;
import java.util.*;
import java.lang.Math;
import Msg;
但是第一行和第四行会产生红色下划线,导致程序无法编译。
我该如何解决这个问题?
您必须将包添加到类路径中。 If you are using an IDE as Eclipse or Netbeans, go to the project options and find the "Add library/jar" and they will take care of you.
您需要将这些库添加到类路径中以编译和运行您的程序。
此外,订购进口商品的常用方式是:
您需要将它们放在构建路径中。
该 daj package 或 jar 文件应该在您的 package 或当前目录或类路径中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.