Maven reports finding the java jdk for 9 but fails. I presume it not is not an openjdk issue because I basically copied the toolchain-sample-linux.xml file to my .m2 folder. I am using maven 3.5.
Thank you guys so much! [INFO] ------------------------------------------------------------------------ [INFO] Building Apache Log4j API Java 9 support 2.9-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ log4j-api-java9 --- [INFO] Deleting /home/kenobi/git/logging-log4j2/log4j-api-java9/target [INFO] [INFO] --- maven-toolchains-plugin:1.1:toolchain (default) @ log4j-api-java9 --- [INFO] Required toolchain: jdk [ version='9' ] *[INFO] Found matching toolchain for type jdk: JDK[/usr/lib/jvm/java-9-openjdk-amd64]* [INFO] [INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) @ log4j-api-java9 --- [INFO] [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ log4j-api-java9 --- [INFO] [INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ log4j-api-java9 --- [INFO] Toolchain in maven-compiler-plugin: JDK[/usr/lib/jvm/java-9-openjdk-amd64] [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /home/kenobi/git/logging-log4j2/log4j-api-java9/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- *[ERROR] javac: invalid flag: --releaseUsage: javac <options> <source files>use -help for a list of possible options* [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Apache Log4j 2 ..................................... SUCCESS [ 4.077 s] [INFO] Apache Log4j API Java 9 support .................... FAILURE [ 3.117 s] [INFO] Apache Log4j API ................................... SKIPPED [INFO] Apache Log4j Core .................................. SKIPPED [INFO] Apache Log4j Core Integration Tests ................ SKIPPED [INFO] Apache Log4j 1.x Compatibility API ................. SKIPPED [INFO] Apache Log4j SLF4J Binding ......................... SKIPPED [INFO] Apache Log4j to SLF4J Adapter ...................... SKIPPED [INFO] Apache Log4j Commons Logging Bridge ................ SKIPPED [INFO] Apache Log4j Flume Bridge .......................... SKIPPED [INFO] Apache Log4j Web ................................... SKIPPED [INFO] Apache Log4j Tag Library ........................... SKIPPED [INFO] Apache Log4j JMX GUI ............................... SKIPPED [INFO] Apache Log4j Samples ............................... SKIPPED [INFO] Apache Log4j Samples: Flume - Common ............... SKIPPED [INFO] Apache Log4j Samples: Flume - Remote ............... SKIPPED [INFO] Apache Log4j Samples: Flume - Embedded ............. SKIPPED [INFO] Apache Log4j Samples: Configuration ................ SKIPPED [INFO] Apache Log4j Samples: LoggerProperties ............. SKIPPED [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SKIPPED [INFO] Apache Log4j Samples: Scala API .................... SKIPPED [INFO] Apache Log4j OSGi .................................. SKIPPED [INFO] Apache Log4j BOM ................................... SKIPPED [INFO] Apache Log4j NoSQL ................................. SKIPPED [INFO] Apache Log4J Performance Tests ..................... SKIPPED [INFO] Apache Log4j Streaming Interface ................... SKIPPED [INFO] Apache Log4j JUL Adapter ........................... SKIPPED [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.938 s [INFO] Finished at: 2017-07-11T16:17:22-07:00 [INFO] Final Memory: 26M/63M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project log4j-api-java9: Compilation failure [ERROR] javac: invalid flag: --release [ERROR] Usage: javac <options> <source files> [ERROR] use -help for a list of possible options [ERROR] [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :log4j-api-java9 On Tue, Jul 11, 2017 at 6:09 AM, Apache <ralph.go...@dslextreme.com> wrote: > Somehow your tool chain is not being found. The --release option is only > available in java 9. When the build runs the compile plugin should tell you > that it is using the Java 9 tool chain. > > Ralph > > > On Jul 10, 2017, at 9:51 PM, kenneth mcfarland < > kennethpmcfarl...@gmail.com> wrote: > > > > I am running Ubuntu 16.04.2 LTS AMD 64 > > > > The sole purpose of my laptop is to get this build to work. I've > literally > > reformatted my machine just for this project and I'm at my wits end > trying > > to figure this out after googling for 2 days. > > > > I've made sure the POM reflects the correct path to my jdk, and I've > > experimented the oracle early release jdk, openjdk 9. I made the > > toolchains.xml file point t the correct java 9 paths. > > > > If it doesn't complain about not finding JDK=9, then it fails on this: > > > > [ERROR] Failed to execute goal > > org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile > > (default-compile) on project log4j-api-java9: Compilation failure > > [ERROR] javac: invalid flag: --release > > [ERROR] Usage: javac <options> <source files> > > [ERROR] use -help for a list of possible options > > > > Other modules in the trunk build fine, but I want them all to build the > way > > they should. Any advice would be greatly apprecaited! > > > > Kenneth > > >