Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

258
Visualizações
run jar with `Error: Could not find or load main class`

I create jar file by Intellij by these steps: File -> Project Structure -> Project Settings -> Artifacts -> Click green plus sign -> Jar -> From modules with dependencies

I run it by java -jar XX.jar, but I get an error: Error: Could not find or load main class com.guangyan.upf.Main

there is my jar file look like: enter image description here

How do I solve this problem? Thanks in advance!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

When creating the jar artifact make sure you have specified the directory for manifest file. Then add the main class in manifest:

Manifest-Version: 1.0
Main-Class: sample.Main

Or else you can follow this tutorial for how to create runnable jar artifact and run it using Gradle in IntelliJ IDEA.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda