| Author |
java compilation process
|
Cristian Negresco
Ranch Hand
Joined: Sep 15, 2001
Posts: 182
|
|
Hi, I would like to know some details about the java compilation procedure. Is it so that compiling with javac 1.4.2_01 will build classes which run with whatever 1.4.2_0x version of the jre? Could I get some professional view/ details about the issue, what is happening while compiling and how the version of the compiler is tied to the classes it compiled? Thanks, Cristian
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
There's a version number embedded in each .class file. In general, the number changes only with a major JDK release: 1.3, 1.4, 1.5 all have different version numbers. Each version of the JVM can read its own class files, and those of all previous versions, but not "future" versions. Changes in class version numbers generally indicate the use of new JVM capabilities (like for example assertions or generics); things that simply won't work on older JVMs. The class file version doesn't change for minor releases like 1.4.1, 1.4.2, etc, and of course not for patchlevels like 1.4.2_01, 1.4.2_02. Minor releases add or change a small number of methods or classes in the API, and patch versions generally fix bugs without changing the API at all. Does that help?
|
[Jess in Action][AskingGoodQuestions]
|
 |
Cristian Negresco
Ranch Hand
Joined: Sep 15, 2001
Posts: 182
|
|
Yes, thanks, it did. -Cristian-
|
 |
 |
|
|
subject: java compilation process
|
|
|