Java bytecode files can be identified by their magic number: 0xCAFEBABE at the beginning of the file. Also the standard naming convention is to have these files' names end in .class.
However, @hexafraction warns in a comment: "Java classfiles would not have their magic number or file extension visible when packed into a .exe PE, except if they were unpacked (assuming that they're just packed in the first place, and not recompiled to machine code)"