EN
IntelliJ IDEA - java 8 error FIX - Usage of API documented as @since 1.7+ less... (Ctrl+F1)
6 points
xxxxxxxxxx
1
Usage of API documented as 1.7+ less... (Ctrl+F1)
2
Inspection info: This inspection finds all usages of methods that have
3
tag in their documentation.
4
This may be useful when development is performed under newer SDK version
5
as the target platform for production.
FIX in 4 steps:
xxxxxxxxxx
1
1. Open Project Structure -> Project
2
-> Project SDK -> change to java / jdk 8
3
4
2. Open Project Structure -> Project
5
-> Project language level -> change to: "8 - Lambdas, type annotations etc."
6
7
3. Open Project Structure -> Modules
8
-> Language level - change to: "Lambdas, type annotations etc."
9
10
4. Open Settings -> Build, Execution, Deployment -> Compiler
11
-> Java Compiler -> Target bytecode version -> change to: "8"
For me it always solves the problem.
3.1. Screenshot - IntelliJ IDEA - Error message

3.2 Screenshot - IntelliJ IDEA change:
- Project SDK
- Project language level

3.3 Screenshot - IntelliJ IDEA change:
- Modules - Language level

3.4 Screenshot - IntelliJ IDEA change:
- Settings -> Java Compiler -> Target bytecode version

Add this plugin to pom.xml and refresh dependencies
xxxxxxxxxx
1
<build>
2
<plugins>
3
<plugin>
4
<groupId>org.apache.maven.plugins</groupId>
5
<artifactId>maven-compiler-plugin</artifactId>
6
<version>3.8.0</version>
7
<configuration>
8
<source>1.8</source>
9
<target>1.8</target>
10
</configuration>
11
</plugin>
12
</plugins>
13
</build>
- Usage of API documented as @since 1.6+ idea
- Usage of API documented as @since 1.7+ idea
- Usage of API documented as @since 1.8+ idea
- Usage of API documented as @since 11+
- IntelliJ IDEA 2015.0.6
- IntelliJ IDEA 2016.3
- IntelliJ IDEA 2017.3
- IntelliJ IDEA 2018.2
- IntelliJ IDEA 2019.1.1
- IntelliJ IDEA 2019.1.2
- IntelliJ IDEA 2019.1.3
- And probably others
Final thought - Java 1.8 should be configured as default.