maurizio said:
What's the jar command to make a jar like those made by sun, with inner
directories and packages.
For example I have a directory1 with inside two directories and files, the
directories contain other files and directory, etc.
Could someone help me?
Regard.
Maurizio
Hi Maurizio,
You can Add files after jar creation with the u option
<shell>
robshep escher:/homedir/robshep/temp % mkdir temp
robshep escher:/homedir/robshep/temp % cd temp
robshep escher:/homedir/robshep/temp/temp % mkdir a
robshep escher:/homedir/robshep/temp/temp % mkdir b
robshep escher:/homedir/robshep/temp/temp % jar -cvf testjar.jar a
added manifest
adding: a/(in = 0) (out= 0)(stored 0%)
robshep escher:/homedir/robshep/temp/temp % jar -uvf testjar.jar b
adding: b/(in = 0) (out= 0)(stored 0%)
robshep escher:/homedir/robshep/temp/temp % jar -tf testjar.jar
META-INF/
META-INF/MANIFEST.MF
a/
b/
</shell>
or you may do it at creation time by specifying all the files and directories that need to go in it.
<shell>
robshep escher:/homedir/robshep/temp/temp % jar -cvf testjar2.jar a b
added manifest
adding: a/(in = 0) (out= 0)(stored 0%)
adding: b/(in = 0) (out= 0)(stored 0%)
robshep escher:/homedir/robshep/temp/temp % jar -tf testjar2.jar
META-INF/
META-INF/MANIFEST.MF
a/
b/
</shell>
any files or directories may also be fully qualified -> jar -cvf Maurizio.jar /etc/passwd /bin/ls /usr/local/man/
basically jar works like tar but has built in zip stuff.
hth
Rob