I am compiling ( javac-ing ) a file with ANT and I get the following message -
C:\eclipse\workspace\titan\com\titan\cabin\CabinBean.java:6: cannot access java.lang.Object bad class file: C:\Program Files\Java\j2re1.4.0_01\lib\rt.jar(java/lang/Object.class) class file has wrong version 48.0, should be 47.0 Please remove or make sure it appears in the correct subdirectory of the classpath.
I suspect this is because javac is finding my 1.4 jdk but should be using my 1.3 jdk. But what I am curious about is the information about the version of java.lang.Object available through an API?
So they are violating the ecapsulation of a class file and extracting a private field, is that right?
Huh? A .class file is kind of like an ELF or COFF object file. It's got various data in it, some of which has to do with the class the file represents, and some of which doesn't. One such piece of information that "doesn't" is the class file version, which we're talking about here. Another such piece of data is the "magic number" that identifies the file as a .class file -- the hex digits "CAFEBABE" at the beginning of the file. This has nothing to do with "violating encapsultation." This just has to do with treating a class file as data used by the JVM and examining it as such, like a traditional linker does.