Languages
[Edit]
EN

IntelliJ IDEA - java 8 error FIX - Usage of API documented as @since 1.7+ less... (Ctrl+F1)

6 points
Created by:
Root-ssh
177980

1. IntelliJ IDEA - Error message:

Usage of API documented as @since 1.7+ less... (Ctrl+F1)
Inspection info: This inspection finds all usages of methods that have 
@since tag in their documentation.
This may be useful when development is performed under newer SDK version 
as the target platform for production.

2. FIX:

FIX in 4 steps:

1. Open Project Structure -> Project
-> Project SDK -> change to java / jdk 8

2. Open Project Structure -> Project
-> Project language level -> change to: "8 - Lambdas, type annotations etc."

3. Open Project Structure -> Modules
-> Language level - change to: "Lambdas, type annotations etc."

4. Open Settings -> Build, Execution, Deployment -> Compiler
-> Java Compiler -> Target bytecode version -> change to: "8"

For me it always solves the problem.

3. FIX with Screenshots


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


4. Partial fix with maven plugin

Add this plugin to pom.xml and refresh dependencies

<build>
   <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.8.0</version>
         <configuration>
            <source>1.8</source>
            <target>1.8</target>
         </configuration>
      </plugin>
   </plugins>
</build>


5. This problem fix applies also to:

  • 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+


6. This problem was seen in:

  • 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.
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

IntelliJ IDEA

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join