Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project does not build with JDK 1.8 (final) - java.lang.ClassCastException: com.sun.tools.javac.main.Main$Result cannot be cast to java.lang.Integer #240

Closed
cushon opened this issue Oct 31, 2014 · 2 comments

Comments

@cushon
Copy link
Collaborator

cushon commented Oct 31, 2014

Original issue created by raphael.andre.bauer on 2014-03-18 at 09:24 PM


Short description

We are using error-prone (latest 1.1.1) in some of our open source maven projects. We just tried to build our project with the final fancy 1.8.0 JDK, but we are getting an error. Removing error prone "fixes" the issue. It also works perfectly fine with the old series 7 JDK.

Thanks for your efforts and looking into this!

The relevant error message is

java.lang.ClassCastException: com.sun.tools.javac.main.Main$Result cannot be cast to java.lang.Integer

coming from:
org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:538)

(Full stack trace below).

My environment

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: /Users/user/applications/apache-maven
Java version: 1.8.0, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"

error-prone libraries and compiler versions

<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                        <compilerId>javac-with-errorprone</compilerId>
                        <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.google.errorprone</groupId>
                            <artifactId>error_prone_core</artifactId>
                            <version>1.1.1</version>
                        </dependency>
                        <dependency>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-compiler-javac</artifactId>
                            <version>2.3</version>
                        </dependency>
                        <dependency>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-compiler-javac-errorprone</artifactId>
                            <version>2.3</version>
                        </dependency>
                    </dependencies>
                </plugin>

Project to reproduce problem:

Open source project at https://github.com/ninjaframework/ninja - tag ninja-3.1.2

(Full stack trace)

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:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.ClassCastException: com.sun.tools.javac.main.Main$Result cannot be cast to java.lang.Integer
    at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne.compileInProcessWithProperClassloader(JavacCompilerWithErrorProne.java:180)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:538)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
    ... 22 more

@cushon
Copy link
Collaborator Author

cushon commented Oct 31, 2014

Original comment posted by raphael.andre.bauer on 2014-03-19 at 01:49 PM


Seems to be related to this one: http://jira.codehaus.org/browse/MCOMPILER-217

@cushon
Copy link
Collaborator Author

cushon commented Oct 31, 2014

Original comment posted by eaftan@google.com on 2014-04-07 at 10:07 PM


(No comment entered for this change.)


Status: Duplicate
Merged Into: #246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant