This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 24166
    
  30

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-
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java compilation process
 
Similar Threads
Quick WAS error
Jar and Javah compilation hangs (on Linux)
java.lang.IllegalAccessError: class A cannot access its superclass B
checking eclipse version
cannot compile servlets