Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: java: javacTask: source release 8 requires target release 1.8 [duplicate]

I have opened git project I was running under Eclipse previously in IntelliJ. I have changed to Java 8 in following places:

File -> Project Structure -> SDKs

and

File -> Project Structure -> Project

Where to set Java 8 else? What it wants?

The project is Maven, pom file has only dependencies sections

UPDATE

I am trying to run under IntelliJ

like image 711
Dims Avatar asked May 25 '15 05:05

Dims


1 Answers

In order to compile your code you should add maven build section:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

Also you can go to File | Settings | Build, Execution, Deployment | Compiler | Java Compiler and change it there, but it will cause other developers failures as they need to modify IDE before build

like image 77
nesteant Avatar answered Sep 27 '22 21:09

nesteant