wood burning stoves 2.0*
The moose likes Java in General and the fly likes java compilation process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java compilation process" Watch "java compilation process" New topic
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: 24183
    
  34

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-
 
Don't get me started about those stupid light bulbs.
 
subject: java compilation process
 
Similar Threads
checking eclipse version
java.lang.IllegalAccessError: class A cannot access its superclass B
Quick WAS error
cannot compile servlets
Jar and Javah compilation hangs (on Linux)