JDK 1.4 Beta 2 won't work with
JBuilder
****************************************************
When
compiling a ".java"-file the compiler puts format version info in the first
bytes of the resulting class file. In Merlin (JDK 1.4) Beta2 Sun has changed the
version info of many of the JDK's class files to '48.0' while previous JDKs used
versions up to '46.0'.
I do not know if there actually are any differences in
the class file format. There are almost certainly some minor changes.
Unfortunately the JDK 1.4 release notes fail to adress this incompatibility. If
anyone knows some details please e-mail me.
The JDK tools provided with the
Beta release can all deal with version '48.0' class files.
But if you use
other tools (like the Borland compiler), they will probably refuse to load the
JDK's class files.
Patch the JDK 1.4 Beta 2
release
******************************************
To be able to play
around with Merlin Beta 2 using JBuilder5, I wrote a little hack, that patches
all jar files in the JDK to a version of max. '46.0'. I got my current project
running without noticing any problems. (Besides I learnt how to use the
java.util.zip/jar-packages :-)
THIS IS A HACK. IT WILL ALMOST CERTAINLY
BREAK SOME CODE. USE AT YOUR OWN RISK.
It might be good to get a first
impression of the Beta. A fix from Borland is needed urgently.
If in any part
of your application you get some strange errors, especially related to class
loading, this patch may well be the reason. Please E-Mail me with details about
where the problems occur.
Get the java source: ClassVersionLimiter.java
If
your JDK's root directory isn't "C:\jdk1.4" (almost certainly if you don't use
windows) then edit the path in the code (one of the very first lines).
Be
sure to have write access to the JDK sub-directories.
Compile the code.
(Using the JDK 1.3.1 that came with JBuilder or use javac at the command
line.)
Run the resulting class. It will patch all class files in all jar
files in your JDK to have a version info of '46.0' at max. The original
jar-files will get copied to .BAK-files.
Comments to mail@StephenKelvin.de