CrossOver Support

Java binfmt is trying to open files instead of Office 2007

Some users report that associations don't work for Office 2007 documents (i.e. double-clicking the document in file browser doesn't work) although these documents open fine in Office 2007 (i.e. "file"->"open" inside the program works) and other applications do work. You can diagnose the issue by running the following in a terminal

CX_LOG=~/logname /opt/cxoffice/bin/cxstart --bottle "Microsoft Office 2007" somefile.docx

Note that the above command will generate a file called "logname" in your home directory, and also the "/opt/cxoffice/bin/cxstart" command assumes that you installed Crossover from the .deb/.rpm package, rather than the .bin file.

The telltale sign of the error is a line:

invalid file (bad magic number): Exec format error

A component of Java (binfmt) detects Office 2007 files (docx, pptx, etc) as its own and passes them to jexec which then refuses them as not being executable files.

The workaround is to remove binfmt and eliminate the conflict.

sudo update-binfmts --remove jar /usr/lib/jvm/java-6-sun- --package sun-java6

And how to add it back if needed:

cp /etc/alternatives/jexec-binfmt /tmp/jar sudo update-binfmts --import /tmp/jar

And under Ubuntu 10.04 the syntax becomes:

sudo update-binfmts --remove jar /usr/bin/jexec --package openjdk-6

And on Ubuntu 12.04:

sudo update-binfmts --remove jar /usr/bin/jexec --package sun-java6

On Fedora 15 there is no "update-binfmt" command, and so one must stop the jexec service, which registers jar associations:

To stop the service: systemctl stop jexec.service

To disable the service: systemctl disable jexec.service

A bug has been filed with the binfmts package to change its handling and hopefully prevent this problem altogether in a future update of Java.
Last modified on 2013-03-06 17:42:17 by Jack Phinney
Are you sure you want to delete this page?
Note: Any nested pages that are under this one will be moved up one level. Any attachments tied to this page will be deleted.
Move / Rename Page
Unknown Error, unable to move!
That page exists already!
One or more of the parent pages specified in new path do not exist!
/support/wiki/ /support/wiki/linux/faq/cxofficejavaassociation
Please Wait...