I've nailed it. Here's what I did.
I first prepended the original rt.jar
to the original rt.jar
, like so:
$ java -Xbootclasspath/p:/path/to/orig/rt.jar -cp /path/to/h2-1.3.174.jar main
And the exception disappeared! This clearly told me that the bootclasspath/p
mechanism was no way interfering with the loading of the H2 driver.
So, I then unjarred the original rt.jar
and diff
'ed it with the unjarred contents of my-rt.jar
, I found around a whopping 8000 files missing from my-rt.jar
:
$ wc -l *.list
11285 my-rt.jar.list
19059 rt.jar.list
30344 total
So, obviously, my-rt.jar
that I built from the official src.zip
had tons of stuff missing from it. No wonder, H2 driver was having loading troubles.
To further confirm, this time I copied over only my tinkered java/lang/Object.class
to the unjarred contents of the original rt.jar
, and lo and behold, the H2 driver continued to load just fine.
Thus, the name src.zip
is a terrible misnomer. Because it does not have everything needed to build rt.jar
, it should be called partial-src.zip
(or, something like that) instead.