Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Major Version and Minor version

 
prasad Venkat
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how Major Version and Minor version of class format depend on jvm
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
major and minor version number are of the compiler which has been used for compiling the java source.I do not think it has to do anything with the JVM.Using a hex editor you can find the major and minor version of the javac which has been used for compilation.If you want to know these details from a class file then you might condider using apaches bcel (byte code engineering language )project.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These version numbers are relevant to the JVM in that class files with newer version numbers won't generally work with older JVMs. Each JVM will have some maximum class file version number that it understands; most famously, these days, JDK 1.4 doesn't know about version 49 class files produced by the Java 5 compiler which contain Java 5-specific code.

Rather than using BCEL (no longer current; it's been superceded by "ASM") or a hex editor, the "javap" tool in the JDK can tell you the version numbers in a class file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic