Use delete instead of del tree.
Also delete dist directory.
Fix creation of jar files.