Child process exited with status 254 error when extracting a tar.xz file

I'm trying to extract a tar.xz file with tar in Mac OS X Lion. I'm using bsdtar 2.8.3 - libarchive 2.8.3. I'm able to use tar to extract anything else I've tried (.zip, .tar, .tar.gz, etc.), but when I try to extract the file (this file to be precise) using tar -Jxf cclive-0.7.11.tar.xz, I get this error:

tar: Error opening archive: Child process exited with status 254Child process exited with status 254

Solution 1:

Same error here (tried GNU tar and the one included in OS X).

You are missing the xz compression program which tar tries to use.

Either install a precompiled xz from Sourceforge or, if you are like me, download the source from http://tukaani.org/xz/ and compile it yourself:

$ ./configure
$ make
$ sudo make install

(Unless told otherwise, ./configure installs xz in /usr/local/bin. You possibly want to add it to $PATH.)

Then:

$ xz --decompress cclive-0.7.11.tar.xz
$ l cclive-0.7.11.tar 
-rw-r--r-- 1 jaume 1832960 2012-12-12 15:18 cclive-0.7.11.tar

Now untar as usual:

$ tar xf cclive-0.7.11.tar