db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: ij gets UnsupportedClassVersionError with JDK 1.3.1 (DERBY-1609)
Date Tue, 01 Aug 2006 02:39:29 GMT
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.


Mime
View raw message