I tried to build derby on Mac OS X and I had issues that I had not expected.

I just wanted to report these for now and see it anyone has suggestions on how to proceed. I am on a 10.4.7 system. The default at this point is usually 1.5, but I set the default JVM back to 1.4.2 for the purposes of building derby. The 1.3 JVM that is on the system is deprecated. Really, it cannot be relied on for anything modern.

1) The build seems to assume that the default JVM is 1.3, but then it does not actually build if one uses that setting. I changed the places in the build.xml files where it hard-coded the "source" and "target" attributes of the javac task to "1.3" to "$ {default.version.JVM}". I set that variable in the ant.properties file. Well, I left the "1.3" where it did not break the build, but this value should be a variable, and not hard-coded into the build.xml files.

2) There were methods missing from some of the java.sql classes. A couple of the interfaces were not completely implemented. I put in stubs so that derby will compile. I would not expect them to work, though.

3) The code, as I checked it out, could not seem to find the JVMInfo.J2SE_16 ivar. I see where this is defined, but I do not see where the build system includes that class in the classpath of the other build.xml files. I just changed the references to JVMInfo.J2SE_16 to its value, 7.

Obviously, these are not the solutions to the issues. Are there other solutions already in progress? Has anyone else build Derby on a Tiger Mac OS X system? I will include my diffs below. I will also put the contents of my ~/ant.properties file here.

thanx - ray

% cd
% cat ant.properties
j13lib=/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/ Classes j14lib=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Classes
javatools.dir=${basedir}/tools/java

java13compile.classpath=${j13lib}/classes.jar:${j13lib}/ui.jar:$ {j13lib}/i18n.jar:${j13lib}/sunrsasign.jar:${javatools.dir}/jdbc2_0- stdext.jar

java14compile.classpath=${j14lib}/classes.jar:${j14lib}/ui.jar:$ {j14lib}/laf.jar:${j14lib}/sunrsasign.jar:${j14lib}/jsse.jar:$ {j14lib}/jce.jar:${j14lib}/charsets.jar

compile.classpath=${java14compile.classpath}
javadoc.tool.jdk14=${java.home}/bin/javadoc

default.version.JVM=1.4
%
% cd Projects/derby
%
% svn diff
Index: java/tools/org/apache/derby/impl/tools/ij/xaHelper.java
===================================================================
--- java/tools/org/apache/derby/impl/tools/ij/xaHelper.java (revision 418662) +++ java/tools/org/apache/derby/impl/tools/ij/xaHelper.java (working copy)
@@ -502,7 +502,7 @@
                                return (XADataSource)
                                        
(Class.forName("com.ibm.db2.jcc.DB2XADataSource").newInstance());
                        else if (isNetClient){
-                            if (JVMInfo.JDK_ID >= JVMInfo.J2SE_16) {
+                            if (JVMInfo.JDK_ID >= 7) {
                                 //running under jdk1.6 or higher
// try instantiating EmbeddedXADataSource40
                                 try {
@@ -520,7 +520,7 @@
                                     ).newInstance());
                         }
                        else {
-                            if (JVMInfo.JDK_ID >= JVMInfo.J2SE_16) {
+                            if (JVMInfo.JDK_ID >= 7) {
                                 //running under jdk1.6 or higher
// try instantiating EmbeddedXADataSource40
                                 try {
Index: java/tools/org/apache/derby/impl/tools/build.xml
===================================================================
--- java/tools/org/apache/derby/impl/tools/build.xml    (revision 418662)
+++ java/tools/org/apache/derby/impl/tools/build.xml    (working copy)
@@ -39,7 +39,6 @@
   </target>
   <target name="compile_tools_impl">
-
     <javac
       source="1.3"
       target="1.3"
@@ -56,6 +55,7 @@
       <classpath>
         <pathelement path="${compile.classpath}"/>
         <pathelement path="${jta1_2}"/>
+        <pathelement path="${out.dir}"/>
       </classpath>
       <include name="${derby.dir}/impl/tools/**"/>
       <exclude name="${derby.dir}/impl/tools/ij/mtGrammar.java"/>
Index: java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
===================================================================
--- java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (revision 418662) +++ java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (working copy)
@@ -52,6 +52,7 @@
import java.sql.PreparedStatement;
import java.sql.CallableStatement;
import java.sql.DatabaseMetaData;
+import java.sql.Savepoint;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
@@ -93,6 +94,12 @@
private static final StandardException exceptionClose = StandardException.closeException();

+ public void releaseSavepoint(Savepoint savepoint) throws java.sql.SQLException { } + public Savepoint setSavepoint() throws java.sql.SQLException { return null; } + public Savepoint setSavepoint(String name) throws java.sql.SQLException { return null; } + public void rollback(Savepoint savepoint) throws java.sql.SQLException { }
+
+
     /**
      * Static exception to be thrown when a Connection request can not
* be fulfilled due to lack of memory. A static exception as the lack
Index: java/engine/org/apache/derby/impl/services/build.xml
===================================================================
--- java/engine/org/apache/derby/impl/services/build.xml (revision 418662)
+++ java/engine/org/apache/derby/impl/services/build.xml        (working copy)
@@ -20,8 +20,8 @@
   <target name="compile_impl_services_169">
     <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -42,8 +42,8 @@

<target name="compile_impl_services" depends="compile_impl_services_169">
     <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -56,7 +56,7 @@
       destdir="${out.dir}">
       <classpath>
         <pathelement location="${jce1_2_1}"/>
-        <pathelement path="${java13compile.classpath}"/>
+        <pathelement path="${java14compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/services/jce/**"/>
     </javac>
Index: java/engine/org/apache/derby/jdbc/build.xml
===================================================================
--- java/engine/org/apache/derby/jdbc/build.xml (revision 418662)
+++ java/engine/org/apache/derby/jdbc/build.xml (working copy)
@@ -23,8 +23,8 @@
<!-- first build all non-special (non jdbc2.0) targets-->
   <target name="compile_jsr169">
     <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -45,8 +45,8 @@
   </target>
          <target name="compile_jsr169_opt">
            <javac
-             source="1.3"
-             target="1.3"
+             source="${default.version.JVM}"
+             target="${default.version.JVM}"
              bootclasspath="${empty}"
              nowarn="on"
              debug="${debug}"
@@ -77,7 +77,7 @@
<!-- Jikes 1.22 in the gump nightly build. -->
     <javac
       source="${jikes.source}"
-      target="1.3"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -89,7 +89,7 @@
       srcdir="${derby.engine.src.dir}"
       destdir="${out.dir}">
       <classpath>
-        <pathelement path="${java13compile.classpath}"/>
+        <pathelement path="${compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/jdbc/EmbeddedDriver.java"/>
       <include name="${derby.dir}/jdbc/ReferenceableDataSource.java"/>
@@ -104,8 +104,8 @@
<!-- Do not use source attribute on javac to remain compatible with versions --> <!-- of Jikes that do not have the source option. -->
     <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -117,7 +117,7 @@
       srcdir="${derby.engine.src.dir}"
       destdir="${out.dir}">
       <classpath>
-        <pathelement path="${java13compile.classpath}"/>
+        <pathelement path="${compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/jdbc/EmbeddedDriver.java"/>
       <include name="${derby.dir}/jdbc/ReferenceableDataSource.java"/>
@@ -130,8 +130,8 @@
  <target name="compile_jdbc3">
     <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
Index: java/engine/org/apache/derby/catalog/ TriggerNewTransitionRows.java
===================================================================
--- java/engine/org/apache/derby/catalog/ TriggerNewTransitionRows.java (revision 418662) +++ java/engine/org/apache/derby/catalog/ TriggerNewTransitionRows.java (working copy)
@@ -25,6 +25,7 @@
import org.apache.derby.iapi.reference.JDBC20Translation;
import java.sql.Connection;
+import java.sql.ParameterMetaData;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -81,6 +82,18 @@
         return resultSet.getMetaData();
     }

+ public ParameterMetaData getParameterMetaData() throws java.sql.SQLException { return null; } + public void setURL(int parameterIndex, java.net.URL x) throws java.sql.SQLException { } + public int getResultSetHoldability() throws java.sql.SQLException { return 0; } + public boolean execute(String sql, String[] columnNames) throws java.sql.SQLException { return false; } + public boolean execute(String sql, int[] columnIndexes) throws java.sql.SQLException { return false; } + public boolean execute(String sql, int autoGeneratedKeys) throws java.sql.SQLException { return false; } + public int executeUpdate(String sql, int autoGeneratedKeys) throws java.sql.SQLException { return 0; } + public int executeUpdate(String sql, int[] columnIndexes) throws java.sql.SQLException { return 0; } + public int executeUpdate(String sql, String[] columnNames) throws java.sql.SQLException { return 0; } + public ResultSet getGeneratedKeys() throws java.sql.SQLException { return null; } + public boolean getMoreResults(int current) throws java.sql.SQLException { return false; }
+
    public ResultSet executeQuery() {
        return resultSet;
    }
Index: java/engine/org/apache/derby/catalog/build.xml
===================================================================
--- java/engine/org/apache/derby/catalog/build.xml      (revision 418662)
+++ java/engine/org/apache/derby/catalog/build.xml      (working copy)
@@ -21,8 +21,8 @@
   <target name="compile_catalog">
     <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
Index: java/engine/org/apache/derby/catalog/ TriggerOldTransitionRows.java
===================================================================
--- java/engine/org/apache/derby/catalog/ TriggerOldTransitionRows.java (revision 418662) +++ java/engine/org/apache/derby/catalog/ TriggerOldTransitionRows.java (working copy)
@@ -25,6 +25,7 @@
import org.apache.derby.iapi.reference.JDBC20Translation;
import java.sql.Connection;
+import java.sql.ParameterMetaData;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -81,6 +82,18 @@
            return resultSet;
        }

+ public ParameterMetaData getParameterMetaData() throws java.sql.SQLException { return null; } + public void setURL(int parameterIndex, java.net.URL x) throws java.sql.SQLException { } + public int getResultSetHoldability() throws java.sql.SQLException { return 0; } + public boolean execute(String sql, String[] columnNames) throws java.sql.SQLException { return false; } + public boolean execute(String sql, int[] columnIndexes) throws java.sql.SQLException { return false; } + public boolean execute(String sql, int autoGeneratedKeys) throws java.sql.SQLException { return false; } + public int executeUpdate(String sql, int autoGeneratedKeys) throws java.sql.SQLException { return 0; } + public int executeUpdate(String sql, int[] columnIndexes) throws java.sql.SQLException { return 0; } + public int executeUpdate(String sql, String[] columnNames) throws java.sql.SQLException { return 0; } + public ResultSet getGeneratedKeys() throws java.sql.SQLException { return null; } + public boolean getMoreResults(int current) throws java.sql.SQLException { return false; }
+
        public int getResultSetConcurrency() {
             return JDBC20Translation.CONCUR_READ_ONLY;
        }
Index: java/drda/org/apache/derby/impl/drda/build.xml
===================================================================
--- java/drda/org/apache/derby/impl/drda/build.xml      (revision 418662)
+++ java/drda/org/apache/derby/impl/drda/build.xml      (working copy)
@@ -21,8 +21,8 @@
   <target name="compile">
   <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -35,13 +35,13 @@
       destdir="${out.dir}">
       <classpath>
         <pathelement location="${jce1_2_1}"/>
-        <pathelement path="${java13compile.classpath}"/>
+        <pathelement path="${compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/drda/DecryptionManager.java"/>
     </javac>
   <javac
-    source="1.3"
-    target="1.3"
+    source="${default.version.JVM}"
+    target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -54,15 +54,15 @@
       destdir="${out.dir}">
       <classpath>
       <pathelement location="${jta1_2}"/>
-        <pathelement path="${java13compile.classpath}"/>
+        <pathelement path="${compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/drda/DRDAXAProtocol.java"/>
       <include name="${derby.dir}/impl/drda/DRDAXid.java"/>
       <include name="${derby.dir}/impl/drda/XADatabase.java"/>
     </javac>
     <javac
-      source="1.3"
-      target="1.3"
+      source="${default.version.JVM}"
+      target="${default.version.JVM}"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -74,7 +74,7 @@
       srcdir="${derby.drda.src.dir}"
       destdir="${out.dir}">
       <classpath>
-        <pathelement path="${java13compile.classpath}"/>
+        <pathelement path="${compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/drda/*.java"/>
       <exclude name="${derby.dir}/impl/drda/DecryptionManager.java"/>
Index: java/client/org/apache/derby/client/am/Configuration.java
===================================================================
--- java/client/org/apache/derby/client/am/Configuration.java (revision 418662) +++ java/client/org/apache/derby/client/am/Configuration.java (working copy)
@@ -204,7 +204,7 @@
      */

     public static boolean supportsJDBC40() {
-        if (JVMInfo.JDK_ID >= JVMInfo.J2SE_16) {
+        if (JVMInfo.JDK_ID >= 7) {
             return true;
         }
         return false;

Reply via email to