Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这可能是一个愚蠢的问题,但是如何或在哪里添加 jgrapht 以便终端中的 java 编译器包含它?我有.jar文件,但不知道放在哪里。
.jar
我正在使用 Mac OS X ML 和 Netbeans。
要使用外部 Java 库,您需要将其添加到类路径中。Java 文档有一些关于如何设置它的重要信息。
假设您使用的是javac编译器,您将使用类似于以下的命令:
javac
javac -classpath jgrapht jar 文件的路径 ... other options and files here ...
javac -classpath
...
other options and files here ...
另请参阅:编译 Java
您特别提到了 Netbeans,因此您还想查看这个问题和这篇博文。
我希望这有帮助!:)