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

esta dando erro na hora de compilar mvn compile !

toda vez que tento, e esta no diretório certo e tudo instalado certo meu jdk é o 1.8

[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< br.com.alura.maven:produtos >---------------------
[INFO] Building produtos 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ produtos ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\natan\Desktop\Estudo alura\produtos\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ produtos ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\natan\Desktop\Estudo alura\produtos\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.223 s
[INFO] Finished at: 2019-02-19T20:59:48-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project produtos: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
3 respostas
solução!

Veja se o java encontrado na variavel de ambiente java_home do seu sistema operacional esta apontando para uma jdk ou para uma jre. se estiver apontando para uma jre, mudar para jdk.

Se vc nao tiver essa variavel de ambiente, siga as instrucoes deste link para cria-la:

https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html

Se fizer um javac - version no terminal vem a versão ?

a versão do javac é 1.8

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