I want to use Java to compress a folder to a tar file (in programmatic way). I think there must be an open source or library to do it. However, I cannot find such method. >
.tar archive files are not compressed. You have to run a file compression on it like gzip and turn it into something like .tar.gz.
.tar
.tar.gz
If you just want to just archive a directory, take a look at: