[Intellij] javacTask: source release 1.8 requires target release 1.8

1. 에러메시지

Error:java: javacTask: source release 8 requires target release 1.8

2. 해결방법

1) 설정변경

  • File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler
  • 아래 이미지 내에 ‘target bytecode version’ 옵션 1.8로 변경

image

2) Maven을 사용할 경우

  • 아래소스 pom.xml에 추가
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

Related Posts