Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

[Dúvida] Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option

Estou recebendo esse erro no meu intellij:

Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option

Acredito que possa estar relacionado com o pom.xml:

<properties>
        <java.version>21</java.version>
        <kotlin.version>1.9.23</kotlin.version>
</properties>
...
<plugin>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-plugin</artifactId>
            <configuration>
                <args>
                    <arg>-Xjsr305=strict</arg>
                    <arg>-jvm-target</arg>
                    <arg>1.8</arg>
                </args>
                <compilerPlugins>
                        <plugin>spring</plugin>
                </compilerPlugins>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-allopen</artifactId>
                    <version>${kotlin.version}</version>
                </dependency>
            </dependencies>
</plugin>

Tentei configurar a jvm-target mas ainda marca como erro no intellij.

print do erro que está acontecendo no meu intellij

2 respostas

Oi!

O projeto desse curso está configurado para funcionar no Java na versão 8, mas no seu IntelliJ está configurado o Java na versão 17.

Altere para o Java 8 e veja se resolve.

solução!

O que resolveu para mim foi iniciar o projeto direto pelo intellij, agora compila certinho.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software