-
Notifications
You must be signed in to change notification settings - Fork 201
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
"duplicate class" compiler errors #117
Comments
This has been tracked down to a bug in the Javac tool. The issue has been reported to Oracle, who have responded by assigning a review id: JI-9023928. The issue can be reproduced as follows. Commands are specific to Linux, but would probably work on Mac or Windows: $ mkdir duplicate-classes-bug
$ cd duplicate-classes-bug
$ wget https://repo1.maven.org/maven2/net/sf/ehcache/ehcache/2.10.0/ehcache-2.10.0-sources.jar
$ wget https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.jar
$ jar -xvf ehcache-2.10.0-sources.jar net/sf/ehcache/statistics/extended/ExtendedStatisticsImpl.java
$ javac -classpath slf4j-api-1.7.12.jar -sourcepath ehcache-2.10.0-sources.jar net/sf/ehcache/statistics/extended/ExtendedStatisticsImpl.java |
Issue link: https://bugs.openjdk.java.net/browse/JDK-8143213 |
I get this error sporadically. Not sure if it's related to this, but it looks very similar. I don't get a "duplicate class" message, but the rest looks similar.
|
The javac bug JDK-8143213 has been marked as a duplicate of https://bugs.openjdk.java.net/browse/JDK-8076104 (closed as fixed in Java 9). (I just tried @stoicflame's reproducer with docker container A Java 8 backport of the fix is tracked here: https://bugs.openjdk.java.net/browse/JDK-8155198 |
This problem ("error: duplicate class") happens 100% of the time if you use the The correct way is to use a separate |
That JDK bug is caused by two classes with the same simple name, but in different packages, being found in the CLASSPATH. However, the enunciate issue appears to happen for application classes with simple names that are unique in the CLASSPATH, e.g. SceneChangeJobResource. I find |
I was having the duplicate class error using the version 2.11.1 (it also happens with 2.13.2).
Appear twice under the 'Compiler sources: ' section. |
As first reported at #103, Enunciate sometimes fails with "duplicate class" compiler errors that looks something like this:
The text was updated successfully, but these errors were encountered: