When I try to compile commons-dbcp-1.2.2 with JDK6/7 I get this error:
org.apache.commons.dbcp.BasicDataSource is not abstract and does not override abstract method isWrapperFor(java.lang.Class) in java.sql.Wrapper
This is because commons-dbcp-1.2.2 was written before JDK6, at a time where java.sql.Wrapper
did not have an isWrapperFor
method.
So I installed JDK5, but I get such messages (probably because of all the Java7-compiled JARs):
java.lang.UnsupportedClassVersionError: Bad version number in .class file
How to solve this problem?
I finally managed to compile commons-dbcp-1.2.2 and here is how I did:
Download revision 558600 (because someone wrote the right patch for it. It is pretty much 1.2.2 with a few fixes)
svn checkout -r 558600 http://svn.apache.org/repos/asf/commons/proper/dbcp/trunk commons-dbcp
Download this patch (explanation of the patch) and patch:
wget https://issues.apache.org/jira/secure/attachment/12362389/patch.txt
patch -p0 <patch.txt
Copy build.properties.sample
to build.properties
, download the jars described in the file, and change to appropriate paths.
Build with OpenJDK 7.