Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7548997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:50:23+00:00 2026-05-30T09:50:23+00:00

I have a maven-based GWT project that includes Guava. I am running into trouble

  • 0

I have a maven-based GWT project that includes Guava. I am running into trouble with Maven trying (and failing) to compile the sources that it finds in guava-gwt*.jar:

could not parse error message:   symbol:   static setCountImpl
  location: class
/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):100: error: cannot find symbol
    return setCountImpl(this, element, count);
           ^

I can’t figure out why Maven thinks it needs to compile the sources in guava-gwt. Here’s what my project looks like:

├── pom.xml
└── src
    ├── main
    │   └── java
    └── test
        └── java
            └── SomeTestFile.java

SomeTestFile.java

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import org.junit.Test;

public class SomeTestFile {
    @Test
    public void testMethod() {
        Multimap<Integer, String> someMap = ArrayListMultimap.create();
        someMap.put(5, "five");
        System.out.println(someMap);
    }

}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>guava-problem</groupId>
    <artifactId>guava-problem</artifactId>
    <version>1.0</version>

    <dependencies>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>11.0.1</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-gwt</artifactId>
            <version>11.0.1</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

I have already tried the following:

  • Removing the guava dependency (leaving only guava-gwt)
  • Scoping guava-gwt to provided

I’m not sure what else to try. guava-gwt includes sources because GWT will compile it into equivalent Javascript. But I don’t want Maven to try to compile these sources.

Edit

Just a note…the test files themselves have no real need for guava-gwt over guava since they are compiled and run as Java code (they don’t go through the GWT compile step). I don’t need guava-gwt specifically for these tests but it needs to be available for my actual GWT client code.

Full Maven Output

mark@mark-peters:~/devel/guava-problem$ mvn -V clean test-compile
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.7.0
Java home: /usr/lib/jvm/jdk1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-38-generic" arch: "amd64" Family: "unix"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - guava-problem:guava-problem:jar:1.0
[INFO]    task-segment: [clean, test-compile]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: /home/mark/devel/guava-problem/target (included: [**], excluded: [])
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/mark/devel/guava-problem/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/mark/devel/guava-problem/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 1 source file to /home/mark/devel/guava-problem/target/test-classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):[19,0] error: cannot find symbol

could not parse error message:   symbol:   static setCountImpl
  location: class
/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):100: error: cannot find symbol
    return setCountImpl(this, element, count);
           ^

could not parse error message:   symbol:   method setCountImpl(AbstractMultiset<E>,E,int)
  location: class AbstractMultiset<E>
  where E is a type-variable:
    E extends Object declared in class AbstractMultiset
/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):105: error: cannot find symbol
    return setCountImpl(this, element, oldCount, newCount);
           ^


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Feb 21 12:49:42 EST 2012
[INFO] Final Memory: 18M/212M
[INFO] ------------------------------------------------------------------------

Edit (again)

Having found that the source of the problem has nothing to do with Guava but rather the Maven version (see my answer), I’ve updated the title and question to try to be a lot more helpful to future users.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:50:24+00:00Added an answer on May 30, 2026 at 9:50 am

    tl;dr

    Maven 2 and JDK 7 are incompatible, as Maven tries to parse javac output which has changed in JDK 7.

    Full explanation

    Raghuram’s note that this worked for him in Maven 3+ took me down the road of exploring this not as a config problem but as an actual Maven problem. I started doing more testing and found that this problem:

    • Occurs with Java 7 and Maven 2.2.1
    • Does not occur with Java 7 and Maven 3+
    • Does not occur with Java 6 and Maven 2.2.1

    So at that point it became clear to me that the “could not parse error message” errors were relevant, and the problem probably had less to do with the guava-gwt compilation occurring and more to do with Maven not knowing how to handle the errors properly.

    To test this I created a separate Maven project that has nothing to do with Guava:

    ├── pom.xml
    └── src
        └── main
            └── java
                └── ClassWithWarnings.java
    

    pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>maven-problem</groupId>
        <artifactId>maven-problem</artifactId>
        <version>1.0</version>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <compilerArgument>-Xlint:all</compilerArgument>
                        <showWarnings>true</showWarnings>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    

    ClassWithWarnings.java

    public class ClassWithWarnings implements java.io.Serializable {}
    

    Lo and behold, Maven tanks on this project as well when using Java 7:

    mark@mark-peters:~/devel/maven-problem$ mvn -V compile
    Apache Maven 2.2.1 (rdebian-1)
    Java version: 1.7.0
    Java home: /usr/lib/jvm/jdk1.7.0/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux" version: "2.6.32-38-generic" arch: "amd64" Family: "unix"
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Unnamed - maven-problem:maven-problem:jar:1.0
    [INFO]    task-segment: [compile]
    [INFO] ------------------------------------------------------------------------
    [INFO] [resources:resources {execution: default-resources}]
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] skip non existing resourceDirectory /home/mark/devel/maven-problem/src/main/resources
    [INFO] [compiler:compile {execution: default-compile}]
    [INFO] Compiling 1 source file to /home/mark/devel/maven-problem/target/classes
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Compilation failure
    could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.3
    /home/mark/devel/maven-problem/src/main/java/ClassWithWarnings.java:1: warning: [serial] serializable class ClassWithWarnings has no definition of serialVersionUID
    public class ClassWithWarnings implements java.io.Serializable {}
           ^
    
    
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Tue Feb 21 13:10:47 EST 2012
    [INFO] Final Memory: 14M/150M
    [INFO] ------------------------------------------------------------------------
    

    With Java 6, it still reports the warnings, but can parse the Javac output and so doesn’t tank:

    Apache Maven 2.2.1 (rdebian-1)
    Java version: 1.6.0_20
    Java home: /usr/lib/jvm/java-6-openjdk/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux" version: "2.6.32-38-generic" arch: "amd64" Family: "unix"
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Unnamed - maven-problem:maven-problem:jar:1.0
    [INFO]    task-segment: [compile]
    [INFO] ------------------------------------------------------------------------
    [INFO] [resources:resources {execution: default-resources}]
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] skip non existing resourceDirectory /home/mark/devel/maven-problem/src/main/resources
    [INFO] [compiler:compile {execution: default-compile}]
    [INFO] Compiling 1 source file to /home/mark/devel/maven-problem/target/classes
    [WARNING] /home/mark/devel/maven-problem/src/main/java/ClassWithWarnings.java:[1,7] [serial] serializable class ClassWithWarnings has no definition of serialVersionUID
    
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Tue Feb 21 13:18:39 EST 2012
    [INFO] Final Memory: 9M/150M
    [INFO] ------------------------------------------------------------------------
    

    So it seems as if the problem was that the latest Maven 2 release doesn’t know how to parse error messages from Java 7+ javac. Maven 3 does. I still haven’t found documentation of this and am a little surprised that Maven doesn’t give a warning when it tries to compile against a JDK version that it doesn’t know how to support properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to instal sbt based project to local maven repository. I have tried
I have a maven project that has a set of library dependancies that are
I have a pom file that looks similar to this <project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
I have two maven-based eclipse projects, one being a project with common classes and
I have a maven based Spring 3.0 project. The Spring configuration file for the
This is the thing ... I have my Maven web project based on spring3.0
i've a maven based project and i'm trying to import it to Spring source
I have maven-plagin and need to run goal, that should automatically run before plugin.
I have a maven project with the following packages (for illustration only): Root: src/main/java
I have a maven project and I'd like to create a distribution of it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.