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.

Maven & AutoValue: Crash on openjdk8, Compile error on openjdk11

See original GitHub issue

Description of the problem

After adding ErrorProne to my project as specified on https://errorprone.info/docs/installation by adding this to my pom.xml:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>8</source>
          <target>8</target>
+          <compilerArgs>
+            <arg>-XDcompilePolicy=simple</arg>
+            <arg>-Xplugin:ErrorProne</arg>
+          </compilerArgs>
+          <annotationProcessorPaths>
+            <path>
+              <groupId>com.google.errorprone</groupId>
+              <artifactId>error_prone_core</artifactId>
+              <version>2.5.1</version>
+            </path>
+          </annotationProcessorPaths>
        </configuration>
      </plugin>

mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V gets me a compiler crash on openjdk8, and a compilation error where @AutoValue generated code isn’t found on openjdk11.

See commit here, was part of this PR.

See full errors from Travis CI here

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

$ git clone git://github.com/google/acai
(make above edit)
$ mvn clean package

What version of Error Prone are you using?

2.5.1

Have you found anything relevant by searching the web?

No. Not sure if the problem is Maven, the maven-compiler-plugin version, AutoValue or the error_prone version either.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
cushoncommented, Feb 11, 2021

Would it make sense to add explicit mention of the <annotationProcessorPaths> to the Maven section in the doc? I ignored that at the end because I thought it didn’t apply, and I didn’t need it before.

Good idea, how does https://github.com/google/error-prone/commit/0b8bd1c7b78515d28088b6c3f0570b4bf8a47502 look?

1reaction
icmdafcommented, Feb 11, 2021

Looks good, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven error :Perhaps you are running on a JRE rather than a ...
I've been facing the same issue with java 8 (ubuntu 16.04), trying to compile using mvn command line. I verified my $JAVA_HOME ,...
Read more >
[AutoValue] JDK6 crash: NoClassDefFoundError: java/lang ...
I tried it to use with OpenJDK6, but it crash while compilation on: An annotation processor threw an uncaught exception.
Read more >
Considerations in adopting RHEL 8 Red Hat Enterprise Linux 8
In Red Hat Enterprise Linux 8, multiple network locations of stage2 or Kickstart files can be specified to prevent installation failure.
Read more >
AutoValue
AutoValue provides an easier way to create immutable value classes, with a lot less code and less room for error, while not restricting...
Read more >
Untitled
MF hamcrest.spec 0001-Fix-build-with-OpenJDK-11.patch hamcrest-2.2.pom ... 5.3.1.tar.gz javapackages-tools.spec module-config.xml toolchains-openjdk8.xml ...
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