Intellij: SBT-based Scala project does not build with Java 9

前端 未结 4 934
离开以前
离开以前 2020-12-15 08:56

I\'ve tried to switch my Scala/sbt based project to Java 9. If I compile the project with sbt, it works.

If I try to build the project with the Build option of Intel

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 09:18

    Moving this as an answer to serve as a temporary suggestion unless there is a definite solution to it and to club together few other points.

    Seems like scala is not yet complete in terms of readiness to be used with JDK-9 as visible at scala/scala-dev - Support JDK 9


    On the other hand, the way of solving the dependency on the javax.xml.bind could be currently categorized into two categories:-

    • Your project uses a library which in turn requires javax.xml.bind, in which case there is not much in your hands other than waiting for that library to move to a modular structure prior to your restructuring. However, this can then be temporarily hacked by the --add-modules javax.xml.bind option provided as the compiler argument.

    • Your project makes use of the javax.xml.bind directly. In which case the ideal solution is to move away from the module and make use of the dependency[jaxb-api:2.3.0] and refactor code accordingly.

提交回复
热议问题