java.class.version is wrong?
Jiro KANAYAMA
majiro at distribution.co.jp
Fri Mar 12 07:57:29 PST 1999
Hello,
gback> > Jiro KANAYAMA writes:
gback> > > Hello,
gback> > >
gback> > > gback> If you start kaffe -D, as in "kaffe -Djava.class.version=46"
gback> > > gback> you can set it to whatever you want.
gback> > >
gback> > > So, in kaffe, has java.class.version different definition from JLS?
gback>
gback> The JLS does not specify a value to my knowledge. The JLS as well as
gback> the JDK doc only say that this property is defined. At least, from my
gback> reading. I'd appreciate a pointer if it does.
Sorry about my inaccuracy explanation.
gback> I haven't seen the value for java.class.version published anywhere. Has
gback> anybody? Note that this is a version number for the class library, not for
gback> the class file format.
See The JavaTM Virtual Machine Specification, 4.1 ClassFile.
================
A class file contains a single ClassFile structure:
ClassFile {
(...cut...)
u2 minor_version;
u2 major_version;
(...cut...)
}
The items in the ClassFile structure are as follows:
(...cut...)
minor_version, major_version
The values of the minor_version and major_version items are the minor and major version numbers of the compiler that produced this class file. An
implementation of the Java Virtual Machine normally supports class files having a given major version number and minor version numbers 0 through
some particular minor_version.
If an implementation of the Java Virtual Machine supports some range of minor version numbers and a class file of the same major version but a higher
minor version is encountered, the Java Virtual Machine must not attempt to run the newer code. However, unless the major version number differs, it will
be feasible to implement a new Java Virtual Machine that can run code of minor versions up to and including that of the newer code.
A Java Virtual Machine must not attempt to run code with a different major version. A change of the major version number indicates a major
incompatible change, one that requires a fundamentally different Java Virtual Machine.
In Sun's Java Developer's Kit (JDK) 1.0.2 release, documented by this book, the value of major_version is 45. The value of minor_version is 3. Only
Sun may define the meaning of new class file version numbers.
================
Also, see JLS1.0, 20.18 The Class java.lang.System.
================
Key Description of associated value
java.class.version Java class format version number
================
And JDK1.0.2 and JDK1.1.7B return value 46.3 about java.class.version.
Then, I 'expected' "Java class fotmat version" mean measure version
and minor version in ClassFile structure.
Please tell me your opinion.
Thanks,
Jiro KANAYAMA
More information about the kaffe
mailing list