question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When I try to compile my project using JDK 9 (https://jdk9.java.net/download/), I get following error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project artemis-commons: Fatal error compiling: CompilerException: InvocationTargetException: java.nio.file.NotDirectoryException: /opt/jdk1.9.ea/lib/modules -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project artemis-commons: Fatal error compiling
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:796)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more
Caused by: org.codehaus.plexus.compiler.CompilerException
    at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne.performCompile(JavacCompilerWithErrorProne.java:95)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
    ... 23 more
Caused by: java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535)
    at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne.performCompile(JavacCompilerWithErrorProne.java:91)
    ... 24 more
Caused by: java.io.UncheckedIOException: java.nio.file.NotDirectoryException: /opt/jdk1.9.ea/lib/modules
    at com.sun.tools.javac.file.Locations$BootClassPathLocationHandler.lazy(Locations.java:725)
    at com.sun.tools.javac.file.Locations$BootClassPathLocationHandler.isDefault(Locations.java:559)
    at com.sun.tools.javac.file.Locations.isDefaultBootClassPath(Locations.java:129)
    at com.sun.tools.javac.file.BaseFileManager.isDefaultBootClassPath(BaseFileManager.java:149)
    at com.sun.tools.javac.main.Arguments.validate(Arguments.java:411)
    at com.sun.tools.javac.main.Main.compile(Main.java:218)
    at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:190)
    at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:101)
    at com.google.errorprone.ErrorProneCompiler.run(ErrorProneCompiler.java:131)
    at com.google.errorprone.ErrorProneCompiler.compile(ErrorProneCompiler.java:73)
    at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne$CompilerInvoker.compile(JavacCompilerWithErrorProne.java:219)
    ... 29 more
Caused by: java.nio.file.NotDirectoryException: /opt/jdk1.9.ea/lib/modules
    at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(java.base@9-ea/UnixFileSystemProvider.java:427)
    at java.nio.file.Files.newDirectoryStream(java.base@9-ea/Files.java:460)
    at java.nio.file.Files.list(java.base@9-ea/Files.java:3506)
    at com.sun.tools.javac.file.Locations$BootClassPathLocationHandler.systemClasses(Locations.java:678)
    at com.sun.tools.javac.file.Locations$BootClassPathLocationHandler.computePath(Locations.java:634)
    at com.sun.tools.javac.file.Locations$BootClassPathLocationHandler.lazy(Locations.java:722)
    ... 39 more

The error-prone-javac assumes that $JAVA_HOME/lib/modules is a directory but in my case it is regular file. I use 1.9.0-dev-r2973-2 version of error-prone-javac.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
cushoncommented, Oct 13, 2017

Error Prone should run on JDK 9 now (see the “Java 9” section http://errorprone.info/docs/installation for instructions). If anyone encounters issues using it from the command line that way, please let us know.

We haven’t done as much testing of the build system integrations: Bazel will work soon, there’s an issue open for gradle (tbroyer/gradle-errorprone-plugin/issues/27), and I’m not sure about maven yet.

Support for using the Java 9 language level (not just running the tool on JDK 9) is work in progress.

1reaction
cushoncommented, Aug 10, 2018

We need up update the rest of the build system installation docs to mention the -Xplugin integration, but Java 9, 10, and 11 are supported now: #860

Read more comments on GitHub >

github_iconTop Results From Across the Web

Oracle Java SE Support Roadmap
Oracle provides this Oracle Java SE Support Roadmap, to help you understand maintenance and support options and related timelines.
Read more >
Oracle JDK 9 and JRE 9 Certified System Configurations
This is the complete list of JDK 9 supported configurations. There are no plans to add additional configurations. On 64-bit operating systems (OSs)...
Read more >
Java 9 - Oracle
Accelerate Java application development with the Java platform module system and 150 new features. Download Java SE 9 today. JavaYourNext (Cloud). Java is ......
Read more >
Java 9 Supported Locales - Oracle
This page documents locale support in Oracle's Java SE Development Kit 9 (JDK) and Java SE Runtime Environment 9 (JRE). Open all Close...
Read more >
Consolidated JDK 9 Release Notes - Oracle
This page contains all of the release notes for the JDK 9 General ... The JDK SunJSSE implementation now supports the TLS FFDHE...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found