1

我已经下载了common.codec二进制 jar 文件。现在我想使用这个类org.apache.commons.codec.binary.Base64。但是这个文件夹包含四个jar文件common.codec-1.7.jarcommons-codec-1.7-javadoc.jarcommons-codec-1.7-sources,,,,, commons-codec-1.7-tests. commons-codec-1a.7-test-sources现在我应该在类路径中提到哪个路径?我尝试使用所有 jar 文件路径并在我的程序中导入但失败了。请告诉我在哪里放置这个下载的 jar 文件以及如何在我的代码中使用它。

4

1 回答 1

5

You can use common.codec-1.7.jar if you are using an IDE like

Eclipse:

1.Right-click your Project.

2.Select Properties.

3.On the left-hand side click java build path.

4.Under Compile tab - click Add External Jars button.

Netbeans :

1.Right-click your Project.

2.Select Properties.

3.On the left-hand side click Libraries.

4.Under Compile tab - click Add Jar/Folder button.

or if you directly compiling classes without IDE you can do as @S.R.I mentioned in comment.

于 2013-04-06T07:06:08.677 回答