Pages

Friday, December 12, 2014

The error describes exactly which is problem: your class file does not start as all java class should, i.e. with 3405691582 (or in hexadecimal CAFEBABE). Instead, your class starts with 1347093252 (hexadecimal 504B0304) that, as indicated in the reference below, it the beginning of a zip/jar file.

How can it happen? Well in my case, I got this problem when I created a jar file to store some of my classes and I used the command:

jar cf my_package1.jar /path/to/classes/*

and clearly something went wrong.
How did I solve it? I slightly changed the command for the jar file in: