1
resposta

Estou recebendo um exceção ``java.lang.UnsatisfiedLinkError`` ao rodar package no eclipse.

Ele gera o arquivo war, e aparentemente ocorre tudo certo. Quando executo no console de windows não aparece nenhum erro.

[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< br.com.alura.maven:lojaweb >---------------------
[INFO] Building lojaweb Maven Webapp 1.0.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ lojaweb ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ lojaweb ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ lojaweb ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\GuilhermeNotebook\Desktop\Cursos\Alura\Formação Java\ServletsEMaven\lojaweb\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ lojaweb ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ lojaweb ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:3.2.2:war (default-war) @ lojaweb ---
[INFO] Packaging webapp
[INFO] Assembling webapp [lojaweb] in [C:\Users\GuilhermeNotebook\Desktop\Cursos\Alura\Formação Java\ServletsEMaven\lojaweb\target\lojaweb]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\GuilhermeNotebook\Desktop\Cursos\Alura\Formação Java\ServletsEMaven\lojaweb\src\main\webapp]
[INFO] Webapp assembled in [63 msecs]
[INFO] Building war: C:\Users\GuilhermeNotebook\Desktop\Cursos\Alura\Formação Java\ServletsEMaven\lojaweb\target\lojaweb.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.596 s
[INFO] Finished at: 2020-08-11T12:18:17-03:00
[INFO] ------------------------------------------------------------------------
Exception in thread "main" java.lang.UnsatisfiedLinkError: java.lang.Shutdown.beforeHalt()V
    at java.lang.Shutdown.beforeHalt(Native Method)
    at java.lang.Shutdown.exit(Unknown Source)
    at java.lang.Runtime.exit(Unknown Source)
    at java.lang.System.exit(Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:349)
1 resposta

Olá José Guilherme, tudo bem? Você está o JDK ou a JRE apenas do Java? Você poderia verificar qual das ferramentas está sendo usada no seu eclipse? Tive um problema semelhante e consegui resolver indo nas preferências (Preferences) do eclipse, depois no abrir o menu Java e por fim na opção Installed JREs, se tiver listado apenas o JRE, então adicione e use o JDK, o maven até pode executar usando apenas a JRE mas gera muitos problemas, o ideal é utilizar o JDK.

E fala pra gente se funcionou!

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