Pregunta

here: create_alias & user_defined_functions it is written:

the Sun javac is compiler is used if the file tools.jar is in the classpath. If not, javac is run as a separate process.

How can one specify java class version for H2 Database User-Defined Functions and Stored Procedures - i.e. javac invocation options for the external javac? Can you always force external javac (even if jdk/tool.jar found)?

for example, H2 is built against java 1.5; I am running on java 1.7:

org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: 
General error: 
"java.lang.UnsupportedClassVersionError: org/h2/dynamic/NEXT_PRIME : 
Unsupported major.minor version 51.0"; SQL statement:
CREATE ALIAS NEXT_PRIME AS $$
        String nextPrime(String value) {
            return new BigInteger(value).nextProbablePrime().toString();
        }
    $$; [50000-167]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
    at org.h2.message.DbException.get(DbException.java:158)
    at org.h2.message.DbException.convert(DbException.java:277)
    at org.h2.command.Command.executeUpdate(Command.java:234)
    at org.h2.server.TcpServerThread.process(TcpServerThread.java:328)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:149)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsupportedClassVersionError: org/h2/dynamic/NEXT_PRIME : 
Unsupported major.minor version 51.0

thanks;

Andrei.

¿Fue útil?

Solución

The error message "Unsupported major.minor version 51.0" indicates you have a JDK or JRE 1.6 in your system that is used in some cases. See also the question unsupported-major-minor-version-51-0.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top