API usage error in intellji

I recently switched to Intellij 2017 IDEA from Eclipse.

in eclipse when creating a new java project we can determine the JDK version imported to project.for for example i have JDK version 1.8 (or 8) installed but in eclipse when i define a new project i can select the jck version imported to my project ... This works completely fine. in Intellij IDE, I added JDK version 1.8 to Project. some of my project's methods work with JDK 1.7 and don't work in 1.8.

the problem is here, i got this error "using api registered since 1.7". I only know this for the addition of JDK 1.7, but I don't want to install an older version of the JDK on my machine. How can I fix this problem?

this solution doesn't work when I decrease the JDK level in my project. File> Project Structure> Project Settings> Modules> your module name> Sources> Language Level>

and this line of code got me Error here:

import java.nio.file.Files;
import java.nio.file.Paths;

      

and when i use this method: Files.isSymbolicLink

thank.

+3


source to share


1 answer


in "project-structure" - change the language level of the project or module to 7.



and in parameter-build-compiler-java -compiler, change the bytecode version also to 7

0


source







All Articles