Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2694

Configure IntelliJ to build with Java 9

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
      None

      There is an apparent change of behavior in Intellij 2017.3 when the project is configured to use Java 9. When the source/target compatibility is set to 1.6, IntelliJ's compilation task seems to exclude any classes that were added after JDK 1.6, resulting in a failure to find classes that the driver relies on when running on later Java versions, e.g. java.nio.channels.AsynchronousSocketChannel and java.time.Instant.

      In the source view, IntelliJ shows no errors and correctly navigates to the location of those classes in their respective Java 9 modules.

      The only workaround I've found is to manually update the language level in the Project Structure dialog after syncing the Gradle build files.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: