Use of '-Xbootclasspath/p:' option preventing H2 driver from being found!

37 views
Skip to first unread message

hs

unread,
Jan 23, 2014, 8:44:11 AM1/23/14
to h2-da...@googlegroups.com
Hi,

I'm finding myself in a very annoying problem, not sure what the cause is.

The Problem: If I build my own rt.jar (called my-rt.jar) from the Oracle JDK7 sources and hook it in with the bootclasspath feature, like this,

    $ java  -Xbootclasspath/p:/path/to/my-rt.jar  -cp /path/to/h2-1.3.174.jar  main

then, I can't even load the H2 driver at the beginning of my program with a statement like this:

    public class main {
        // ...
        public static void main(String[] args) {
            Class.forName("org.h2.Driver");      // Line 145
            // ...
        }
    
    }

The above program gives me a ClassNotFoundException.

    Exception in thread "main" java.lang.ClassNotFoundException: org/h2/Driver
         at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:190)
         at main.main(main.java:415)

However, if I remove the -Xbootclasspath option and with everything else the same as before, then I can in fact load the driver fine and the rest of application too works just fine - which confirms that there's nothing amiss with my-rt.jar!

Question: Is there anything special going on inside the initialization of the H2 driver that's preventing me from using the bootclasspath option?

I'm really stuck because of this, so would greatly appreciate if someone who has a clue could respond right away.

(I'm out of things to try. For example, I've even re-built the H2 driver from its sources and made sure that both my app the driver are using the identical version of javac.)

Many thanks in advance,
/hs


Reply all
Reply to author
Forward
0 new messages