Search code examples
javacommand-linejarcompressionwinrar

Extract a JAR file, possibly with WINRAR on CL


I need to be able to extract jar files on the command line.

Piece of cake, you might say. Yes, except I need the extractor to rename same-named files. To be specific, the Jar file has a file named:

classAX.class 

and another named:

classax.class

in the same directory. I need it to extract them both, and preferably rename one:

classax (2).class

or something similar.

It must be able to do this without any user intervention.

Winrar has this capability, but when attempting to extract with unrar.exe, it says that the input file is not a valid RAR archive. (Though winrar has jar capabilities.)

Any way to force winrar to accept jars via command line, or perhaps another program?

Thanks,

~Kurt Nauck


Solution

  • 7Zip command line util accomplishes this perfectly. Thanks for the answers.