When I tried to build my Java code which has switch expressions using Gradle, it throws this error:
error: switch expressions are a preview feature and are disabled by default.
I tried running ./gradlew build --enable-preview
which didn't work either.
I'm using Gradle 5.3.1.