Intellij - Unable to use newer Java 8 classes - Error : “Usage of API documented as @since 1.6+..”

前端 未结 8 1177
我寻月下人不归
我寻月下人不归 2020-11-28 19:00

I\'m trying to use a java.lang.function.Function in my java 8 code base, but i keep getting the following error in Intellij.

Usage of API

8条回答
  •  臣服心动
    2020-11-28 19:23

    There is one other place that might be causing this issue, regardless of whether or not you are using Maven or Gradle.

    In Settings | Editor | Inspections | Java language level migration aids | Usages of API which isn't available at the configured language level, the default (I believe) is set to Respecting to project language level settings, but it can be set to Higher than: , which ignores project settings.

    Meaning that if you follow the instructions in the other answers and set your project's language level to, say, 8, but the inspection is set to Higher than: 7, IDEA will still throw a fit.

提交回复
热议问题