问题
When I use this command:
echo C:\Program Files\Java\jdk1.7.0_07\bin
jar -cf C:\file\file.jar C:\data\
in the CMD for the jar-Archive tool, it creates the .jar called "file.jar" in C:\file\, but it doesn't add the files from the folder C:\data, it creates an archive with the folder C: -> data -> files (in this case text.txt). How can I set the path for the folder with the content in it? I only want the files in the folder C:\data\ in my archive. How can I do this?
Thanks, DigitalClark.
btw.: Is there any way to do this without JDK? Is there another tool? I don't want the users to install JDK to use just a little program...
回答1:
This should work, maybe you have to omit the last slash:
jar -cf C:\file\file.jar C:\data
Concerning your last question: Java JDK .jar archive tool alternative
Yes, you can use any program that can create zip archives. Your probably have to rename them from *.zip to *.jar
来源:https://stackoverflow.com/questions/12872936/java-jar-archive-tool-set-path-for-folder-with-content