Hi there
I have a very specific technical problem during ant compilation.
There error message is as follows:
test_database:
[java] 2018-03-26 09:51:20,494 WARN
org.dspace.services.email.EmailServiceImpl @ Couldn't get an email session from
environment: Need to specify class name in environment or system property, or
as an applet parameter, or in an application resource file:
java.naming.factory.initial
[java] Exception: org/postgresql/Driver : Unsupported major.minor version
52.0
[java] java.lang.UnsupportedClassVersionError: org/postgresql/Driver :
Unsupported major.minor version 52.0
[java] at java.lang.ClassLoader.defineClass1(Native Method)
[java] at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
[java] at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
[java] at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:195)
[java] at
org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2124)
[java] at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
[java] at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
[java] at
org.dspace.storage.rdbms.DatabaseUtils.setupFlyway(DatabaseUtils.java:473)
[java] at
org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:98)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:606)
[java] at
org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
[java] at
org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
I pretty certain this is because Ant is using Java 1.7 to compile instead of
1.8.
Java version:
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
Alternatives conf;
alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 java-1.8.0-openjdk.x86_64
(/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre/bin/java)
2 java-1.7.0-openjdk.x86_64
(/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161-2.6.12.0.el7_4.x86_64/jre/bin/java)
And ant diagnostics:
------- Ant diagnostics report -------
Apache Ant(TM) version 1.9.2 compiled on June 10 2014
java.runtime.version : 1.7.0_161-mockbuild_2017_12_06_14_27-b00
java.specification.version : 1.7
java.vm.specification.version : 1.7
java.version : 1.7.0_161
I've added
<echo message="Ant running on Java version ${ant.java.version}"/>
into the build xml file which confirms that Ant is compiling in 1.7
I've tried adding
<javac srcdir="." source="1.8" target="1.8" includeantruntime="false"/>
into the build.xml as well in the test_database target but that doesn't seem to
make a difference.
Any help would be greatly appreciated. I realise reinstalling Ant might be the
most straightforward solution but this is on a server I don't have easy access
to so I want to try the config approach first.
Hrafn
--
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
--
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.