Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compatibility and versions of java

 
Raghavendra Shockley
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15436
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic