Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
2  
It seems that you should ask this question somewhere else e.g. stackoverflow.com. –  XinHua Apr 30 '12 at 6:15
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.