Forum: Installation

Post: Compiling under Java 7 on Ubuntu 11.04

Compiling under Java 7 on Ubuntu 11.04
ealdent
Sep 16, 2011
Maybe I'm missing where it says this can't be done, but when I try to compile the source under java 7, I get a slew of errors (indicative sample below). Is this just not going to happen for me, or am I missing something obvious?


compile_core:
[javac] Compiling 369 source files to /home/jason/source/voltdb/obj/release/prod
[javac] /home/jason/source/voltdb/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCConnection.java:519: error: JDBCConnection is not abstract and does not override abstract method getNetworkTimeout() in Connection
[javac] public class JDBCConnection implements Connection {
[javac] ^
[javac] /home/jason/source/voltdb/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCPreparedStatement.java:258: error: JDBCPreparedStatement is not abstract and does not override abstract method isCloseOnCompletion() in Statement
[javac] public class JDBCPreparedStatement extends JDBCStatementBase implements PreparedStatement {
[javac] ^
[javac] /home/jason/source/voltdb/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCCallableStatement.java:290: error: JDBCCallableStatement is not abstract and does not override abstract method <T>getObject(String,Class<T>) in CallableStatement
[javac] public class JDBCCallableStatement extends JDBCPreparedStatement implements CallableStatement {
[javac] ^
[javac] where T is a type-variable:
[javac] T extends Object declared in method <T>getObject(String,Class<T>)
[javac] /home/jason/source/voltdb/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java:318: error: JDBCResultSet is not abstract and does not override abstract method <T>getObject(String,Class<T>) in ResultSet
[javac] public class JDBCResultSet implements ResultSet {
[javac] ^
[javac] where T is a type-variable:
[javac] T extends Object declared in method <T>getObject(String,Class<T>)
[javac] /home/jason/source/voltdb/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCDataSource.java:108: error: JDBCDataSource is not abstract and does not override abstract method getParentLogger() in CommonDataSource
[javac] public class JDBCDataSource implements Serializable, Referenceable, DataSource
[javac] ^

Looks like Java 7 made some backward incompatible changes...
sebc
Sep 16, 2011
In this specific case it seems the JDBC interfaces have been changed.


We definitely have to look at Java 7 but for now, you should stick to version 6, which is what we validate VoltDB for, for production use.

Cheers,

Seb
Java 7 JDBC
rbetts
Sep 16, 2011
Java 7 versioned JDBC, adding new methods to existing Java 6 JDBC interfaces.


http://download.oracle.com/javase/6/docs/api/java/sql/Connection.html
http://download.oracle.com/javase/7/docs/api/java/sql/Connection.html#getNetworkTimeout()

There shouldn't be too many roadblocks to remove to enable java 7 compilation -- hopefully someone can get around to these changes. Would be fun to get VoltDB compiled on Java 7.


The code in question here is actually HSQL JDBC code. We use HSQL's SQL parser but don't use any of its JDBC (or storage, or SQL execution) logic. This is all code that can be removed, if you're interested.

Ryan.
Thanks for the quick
ealdent
Sep 16, 2011
Java 7 versioned JDBC, adding new methods to existing Java 6 JDBC interfaces.

http://download.oracle.com/javase/6/docs/api/java/sql/Connection.html
http://download.oracle.com/javase/7/docs/api/java/sql/Connection.html#getNetworkTimeout()

There shouldn't be too many roadblocks to remove to enable java 7 compilation -- hopefully someone can get around to these changes. Would be fun to get VoltDB compiled on Java 7.

The code in question here is actually HSQL JDBC code. We use HSQL's SQL parser but don't use any of its JDBC (or storage, or SQL execution) logic. This is all code that can be removed, if you're interested.

Ryan.


Thanks for the quick response. I was afraid that was the case. :)