Andrew McIntyre wrote:
> A recent change to ij.java added the following line:
> 
> +          ijE = new org.apache.derby.impl.tools.ij.Main14(false);
> 
> Apparently the default classloader, when it sees that this class may
> be instantiated, will attempt to load this class. On JDK 1.3.1, this
> leads to an UnsupportedClassVersionError being thrown, since Main14 is
> compiled with "-target 1.4". The solution is probably to load the
> class via reflection. At the end of this mail is a proposed solution,
> but I'm sure it could be improved. I simply catch and report any of
> the exceptions that are thrown by the reflection methods. We're
> unlikely to hit any of them, and throwing them seemed like quite a
> burden for a public API, but maybe there's a better way to handle all
> these. I also haven't tried this with the security manager yet.

Interesting, the  ij class already had this code:

          /* We decide which verion of ij (2.0 or 4.0) to
           * load based on the same criteria that the JDBC driver
           * uses.
           */
          if (JVMInfo.JDK_ID == JVMInfo.J2SE_13)
          {
                  Main.main(args);
          }
          else
          {
                  org.apache.derby.impl.tools.ij.Main14.main(args);
          }

So I'd assumed since it was loading Main14, then my new code would be ok
as well.

Dan.

Reply via email to