Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-10108

Duplicate Class Error when using vaadin (which contains java-files)

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: Scala 2.11.8
    • Fix Version/s: None
    • Component/s: Compiler (Misc)
    • Labels:
      None

      Description

      Hi,

      when scala is cross compiling java files, I get an duplicate class error:

      Executing org.gradle.api.internal.tasks.scala.ZincScalaCompiler@23c084bd in compiler daemon.
      Compiling with Zinc Scala compiler.
      Compiling 1 Java source to /Users/ggr/Downloads/demo/build/classes/main...
      /Users/ggr/.gradle/caches/modules-2/files-2.1/com.vaadin/vaadin-server/7.7.5/28bc909336b9b399d93926b99148ce66d1bf3ed3/vaadin-server-7.7.5.jar(com/vaadin/annotations/JavaScript.java):58: error: duplicate class: com.vaadin.annotations.JavaScript
      public @interface JavaScript {
              ^
      /Users/ggr/.gradle/caches/modules-2/files-2.1/com.vaadin/vaadin-server/7.7.5/28bc909336b9b399d93926b99148ce66d1bf3ed3/vaadin-server-7.7.5.jar(com/vaadin/server/Page.java):36: error: cannot access JavaScript
      import com.vaadin.ui.JavaScript;
                          ^
        bad source file: /Users/ggr/.gradle/caches/modules-2/files-2.1/com.vaadin/vaadin-server/7.7.5/28bc909336b9b399d93926b99148ce66d1bf3ed3/vaadin-server-7.7.5.jar(com/vaadin/ui/JavaScript.java)
          file does not contain class com.vaadin.ui.JavaScript
          Please remove or make sure it appears in the correct subdirectory of the sourcepath.
      Exception executing org.gradle.api.internal.tasks.scala.ZincScalaCompiler@23c084bd in compiler daemon: org.gradle.api.internal.tasks.compile.CompilationFailedException: javac returned nonzero exit code.
      :compileScala FAILED
      :compileScala (Thread[main,5,main]) completed. Took 4.81 secs.
      

      When I remove the java files in the vaadin-server jar file, it works. When I only use java (no scala) it is also no problem, that java files are contained in the jar side to side with the class files.

      Demo to reproduce problem is attached. Just extract, go in and type ./gradlew clean testClasses --info

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              guenther Guenther Grill
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: