The instructions in COMPILING.md say to install Debian package openjdk-8-jdk (or openjdk8 on FreeBSD), but that is not sufficient. It must also be the default Java version. If JDK 8 is installed, but the default is JDK 25, then under Ubuntu the build fails with:
[ERROR] COMPILATION ERROR :
[ERROR] cbmc/jbmc/lib/java-models-library/src/main/java/java/lang/Object.java:[40,7] flexible constructors is not supported in -source 8
(use -source 25 or higher to enable flexible constructors)
[ERROR] cbmc/jbmc/lib/java-models-library/src/main/java/java/lang/Class.java:[199,24] cannot find symbol
symbol: method checkClassLoaderPermission(java.lang.ClassLoader,<nulltype>)
location: class java.lang.ClassLoader
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project models: Compilation failure: Compilation failure:
[ERROR] cbmc/jbmc/lib/java-models-library/src/main/java/java/lang/Object.java:[40,7] flexible constructors is not supported in -source 8
[ERROR] (use -source 25 or higher to enable flexible constructors)
[ERROR] cbmc/jbmc/lib/java-models-library/src/main/java/java/lang/Class.java:[199,24] cannot find symbol
[ERROR] symbol: method checkClassLoaderPermission(java.lang.ClassLoader,<nulltype>)
[ERROR] location: class java.lang.ClassLoader
[ERROR] -> [Help 1]
The instructions in
COMPILING.mdsay to install Debian packageopenjdk-8-jdk(oropenjdk8on FreeBSD), but that is not sufficient. It must also be the default Java version. If JDK 8 is installed, but the default is JDK 25, then under Ubuntu the build fails with: