Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Java .class file. Now I want to check it was compiled on a 32 bit machine or 64 bit machine ? I tried file command but it just says it is a compiled java class. Is there any way to find it?

share|improve this question
It seems that you should ask this question somewhere else e.g. stackoverflow.com. – XinHua Apr 30 '12 at 6:15
up vote 4 down vote accepted

Java class files are platform independent. There are no "64bit class files", they are all the same format.

The things that can hinder portability of class files and libraries are:

  • required native code (this is obviously platform specific, including "bitness")
  • target version used to compile the classes (classes compiled for newer JVM targets cannot be loaded by older ones)

Other than that, you can compile your classes with a 32bit JDK and run them on a 64bit JVM (or the other way around) – it'll just work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.