Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

260
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda