Compatibility between versions and architecture in Java


When I create an application with a specific Java development kit, for example, the architecture of 64 bits and the version 8 >:

  • Can this application work on any virtual machine ( JRE )? Or should it be the same architecture and version?

  • If I wanted to run my application in another architecture, would I have to use the equivalent JDK to develop my application?

  • asked by JD0001 27.03.2017 в 11:06

    1 answer


    For the answer you have to differentiate between two variables.

    • the bytecode produced by the compiler is independent of the platform and runs on a variety of virtual machine deployments, such as HotSpot , IBM J9, Dalvik, OpenJDK or others, independent with which SDK was generated.
    • The version of Java used (Java6, Java7, Java8) specified as "target version" can not be higher than the version of the virtual machine.

    For example: Java code compiled with a 64bit SDK with "target version" Java 7, for example, runs on all 32bit or 64bit virtual machines from version 7 upwards.

    answered by 27.03.2017 / 16:06