I experienced the same issue, however in my case it was due to the Configuration settings in IntelliJ IDEA.
Even though the project SDK (File -> Project Structure) was set to Java 11, the JRE in the Run/Debug Configurations (Run -> Edit Configurations) was set to Java 8. After changing that to Java 11, it worked like a charm.