my dog learned polymorphism
The moose likes Java in General and the fly likes Major Version and Minor version Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Major Version and Minor version " Watch "Major Version and Minor version " New topic

Major Version and Minor version

prasad Venkat
Ranch Hand

Joined: Oct 17, 2006
Posts: 32
how Major Version and Minor version of class format depend on jvm
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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.

Rahul Bhattacharjee
LinkedIn - Blog
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

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.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Major Version and Minor version
It's not a secret anymore!