This week's book giveaway is in the Other Open Source APIs forum.
We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line!
See this thread for details.
The moose likes Java in General and the fly likes Compatibility and versions of java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Storm Applied this week in the Other Open Source APIs forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Compatibility and versions of java" Watch "Compatibility and versions of java" New topic

Compatibility and versions of java

Raghavendra Shockley
Ranch Hand

Joined: Jan 21, 2012
Posts: 69
Will code compiled on a 64 bit OS using 64 bit java run on a 32bit OS using 32 or 64 bit java ?
To what extent is java 7 backward compatible with java 5 and 6 ?

Back to square one.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42955
Java class files have no concept of 32 vs. 64 bit - it makes no difference.

Classes compiled with Java 7 can run on earlier JVM versions provided appropriate -source and -target switches were used, AND the code doesn't use Java 7 features or doesn't use them on earlier JVMs. That's show it has always worked.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14725

Java 7 should be able to run Java code compiled with any older version without modifications, except for minor issues. See Java SE 7 and JDK 7 Compatibility.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
jQuery in Action, 2nd edition
subject: Compatibility and versions of java