我在创建 jar 时遇到问题。详情如下:
[amulay@pugthesestock-dr Desktop]$ ll src/com/foo/bar/
-rw-rw-r-- 1 amulay amulay 421 Jul 17 11:40 Test1.class
-rw-rw-r-- 1 amulay amulay 125 Jul 17 11:40 Test1.java
-rw-rw-r-- 1 amulay amulay 421 Jul 17 11:40 Test2.class
-rw-rw-r-- 1 amulay amulay 125 Jul 17 11:39 Test2.java
[amulay@pugthesestock-dr Desktop]$ jar -cvf Test.jar -C src src/com/foo/bar/*.class
src/src/com/foo/bar/Test1.class : no such file or directory
added manifest
adding: com/foo/bar/Test2.class(in = 421) (out= 288)(deflated 31%)
[amulay@pugthesestock-dr Desktop]$ unzip -l Test.jar
Archive: Test.jar
Length Date Time Name
--------- ---------- ----- ----
0 07-17-2013 11:47 META-INF/
68 07-17-2013 11:47 META-INF/MANIFEST.MF
421 07-17-2013 11:40 com/foo/bar/Test2.class
--------- -------
489 3 files
文件 Test2.class 被添加到 jar 中,但不是 Test1.class?