This discussion is archived
4 Replies Latest reply: Apr 24, 2012 7:48 PM by EJP RSS

Differences of JDK x86 and JDK x64

932808 Newbie
Currently Being Moderated
Dear all,

I am in the progress on studying Java update with existing program.

For previous, the program is complied in eclipse under JDK 1.4.2.

We are now updating the JRE and JDK 1.6 update 30, however, there are several questions. Most appreciated if any one can provide a direction or guidance on it.

1. As my understanding, Java should be able to compile and run under x86 and x64 platform, and it should be no difference on the compiled classes. The only difference should be x86 JVM and x64 JVM (for example, x86 JVM has better than x64 JVM, and x64 JVM should be support larger address range than x86 JVM). If not, what will be differences among classes compiled under x86 and that of x64?

2. The x86 classes can be executed under x64 JVM. Can the x64 classes be executed under x86 JVM? Although, the classes will be read into byte stream into VM...

3. If we need the x64 classes to execute under x86 environment, what should we do? If the x64 classes cannot be run in x86 JVM.
  • 1. Re: Differences of JDK x86 and JDK x64
    gimbal2 Guru
    Currently Being Moderated
    929805 wrote:
    1. As my understanding, Java should be able to compile and run under x86 and x64 platform, and it should be no difference on the compiled classes. The only difference should be x86 JVM and x64 JVM (for example, x86 JVM has better than x64 JVM, and x64 JVM should be
    support larger address range than x86 JVM). If not, what will be differences among classes compiled under x86 and that of x64?
    None. There is no such thing as X86 classes and x64 classes, there are only "classes".

    Your other two questions are now obsolete.
  • 2. Re: Differences of JDK x86 and JDK x64
    932808 Newbie
    Currently Being Moderated
    Thanks for your reply.

    If the class is platform independent, can i say that the classes compiled under x86 platform is the same as that in x64 platform?

    In addition, the difference on x86 and x64 java is only on JVM container only (due to the architecture of OS)?

    Is there documentation or reference (e.g. Java Knowledge Base, etc) stating this issue?

    Sorry for long question
  • 3. Re: Differences of JDK x86 and JDK x64
    DrClap Expert
    Currently Being Moderated
    929805 wrote:
    Is there documentation or reference (e.g. Java Knowledge Base, etc) stating this issue?
    There is documentation which states how Java compiled code must be handled within a JVM. (The Java Virtual Machine Specification.) Here's a quote from very close to the beginning:
    The Java virtual machine is an abstract machine.
    So you shouldn't expect it to mention specific machine architectures, or to specify how it should work on any particular machine architecture. On the contrary, you should expect it to ignore the existence of different machine architectures. And likewise when it gets around to describing the class file format, it simply provides an abstract description. It's up to the implementers to write something which runs in a particular machine architecture and which faithfuylly implements the JVM specification.
  • 4. Re: Differences of JDK x86 and JDK x64
    EJP Guru
    Currently Being Moderated
    Is there documentation or reference (e.g. Java Knowledge Base, etc) stating this issue?
    There is no documentation or reference that says anything else!

    Specifically, there is no mention whatsoever of specific computer architectures in the Java Class File Specification in the JVM Specification.

    You can prove it for yourself by comparing the outputs of the 32 and 64 bit compilers.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points