0

In IntelliJ I created Maven run configuration, that looks like this:

Maven run configuration

When I run it, I get .jar file:

Maven .jar file

And when I run it, I get this message:

"C:\Program Files (x86)\Java\jdk1.8.0_251\bin\java.exe" -Dfile.encoding=windows-1250 -jar D:\Projekty\Programowanie\Portfolio\java-studying\MavenHelloWorld\target\MavenHelloWorld-1.0-SNAPSHOT.jar
no main manifest attribute, in D:\Projekty\Programowanie\Portfolio\java-studying\MavenHelloWorld\target\MavenHelloWorld-1.0-SNAPSHOT.jar

How do I run this .jar file from intelliJ?

seenukarthi
  • 8,241
  • 10
  • 47
  • 68
pkonopacki
  • 16
  • 2

1 Answers1

0

You don't need to compile into a jar file, there's a terminal in IntelliJ to display println, just press the green start button in App.

In the future, follow these steps to create manifest and use Build>Build Artifacts>name.jar>Build to create a runnable jar file:

  1. https://prnt.sc/txmlul
  2. https://prnt.sc/txmp28
  3. https://prnt.sc/txmsqa