0

I am trying to decompress .z file from java on a 64-bit windows machine. This compressed file contains folders and files. How do i do this?

I have tried the following:

ProcessBuilder pb = new ProcessBuilder("uncompress", zFilePath);
Process p = pb.start();

But i get this:

java.io.IOException: Cannot run program "uncompress": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)

Please advise,

thanks!

Rookie
  • 5,179
  • 13
  • 41
  • 65
  • the answer posted on the other thread did not work for me. I am getting a null pointer exception: at sqlfinder.UnZip$1.write(UnZip.java:48) at net.sf.sevenzipjbinding.impl.InArchiveImpl.nativeExtract(Native Method) at net.sf.sevenzipjbinding.impl.InArchiveImpl.extractSlow(InArchiveImpl.java:107) at net.sf.sevenzipjbinding.simple.impl.SimpleInArchiveItemImpl.extractSlow(SimpleInArchiveItemImpl.java:190) at sqlfinder.UnZip.main(UnZip.java:41) – Rookie May 11 '15 at 19:01
  • `.z` is the good old Unix compress format - this is different from 7z. – Stefan Bodewig May 12 '15 at 04:25
  • 1
    I wish I could write a full answer. `CreateProcess error=2` is "file not found" so `uncompress` is either not installed or not on your `PATH`. Apache Commons Compress provides a pure Java alternative - http://commons.apache.org/proper/commons-compress/ – Stefan Bodewig May 12 '15 at 04:28
  • Thanks Stepfan!!! I will take a look at the Apache project – Rookie May 13 '15 at 22:03

0 Answers0