JDK-4411971 : jar tool and -C and wildcards
  • Type: Enhancement
  • Component: tools
  • Sub-Component: jar
  • Affected Version: 1.2.1,1.2.2,1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_98
  • CPU: generic,x86
  • Submitted: 2001-02-05
  • Updated: 2002-04-27
  • Resolved: 2002-04-27
Related Reports
Duplicate :  
Description

Name: ssT124754			Date: 02/05/2001


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)


I am trying to update a java archive.
I have a directory Packages, which has a subdirectory BVUtility.
In that BVUtility are some .class files (wanted), as well as some other files
(not wanted).

If I execute the following command, the archive tool correctly adds all files in
the BVUtility directory to the archive:

jar uvf xyz.jar -C Packages BVUtility

These files will not have a \Packages directory, but they will have a \BVUtility
directory, which is what I want.

However, in that BVUtility directory, I have files other than .class files. I do
not want these files in the .jar. So I try this

jar uvf xyz.jar -C Packages BVUtility/*.class

Ands it fails with

Packages\BVUtility\*.class : no such file or directory
java.io.IOException: Error in writing existing jar file
        at sun.tools.jar.Main.run(Main.java:179)
        at sun.tools.jar.Main.main(Main.java:904)

Although there are indeed .class files in that directory.

This seems like something MANY people would like to do if they are using
packages extensively.

It is somewhat related to Bug 4193358, but not quite the same.
(Review ID: 116402) 
======================================================================

Comments
WORK AROUND Name: ssT124754 Date: 02/05/2001 I suppose I could create a duplicate directory structure with just the .class files in them, and then create the archive from there......but that would be a lot of wasted people time, CPU time, and disk space. I would have to mirror the direcories every time any class changed. ======================================================================
11-06-2004

EVALUATION We will consider this RFE for a future release. It will take some reworking of the JAR tool, and won't be done for 1.4. andrew.bennett@eng 2001-03-20
20-03-2001