0

When I try to run a (Vaadin Spring Boot) application I created in Intellij Idea:

java -jar MyApp.jar

... I get the following error message:

"no main manifest attribute, in MyApp.jar"

I tried several of the solutions to this problem provided in posts pertaining to the same problem but I keep getting this error message.

Does anybody know a solid way to avoid this error message?

By the way:

the manifest file does exist:

enter image description here

and has the following content:

Manifest-Version: 1.0
Main-Class: com.my_app.MyAppApplication

************************************UPDATE***********************************

MINIMAL EXAMPLE:

Using SpringInitializr (https://start.spring.io), I created a mini-app called minimalExample2. The SpringInitializr tags used are:

enter image description here

After creating a jar-file, the project-structure looks as follows:

enter image description here

The content of the MANIFEST.MF file is the following:

Manifest-Version: 1.0
Main-Class: com.example.minimalExample2.MinimalExample2Application

When I want to run the app using

java -jar minimalExample2.jar 

... I get the following error message:

"no main manifest attribute, in minimalExample2.jar"

You can easily replicate this app in a few seconds by selecting the two tags "Web" and "Vaadin" in Springinitializr and then clicking on "Generate Project".

steady_progress
  • 3,311
  • 10
  • 31
  • 62
  • 1
    Are there any jars with the digital signatures in the dependencies? Are there any jars with their own manifest files that can override IntelliJ IDEA manifest? You should share the [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) to get help. – CrazyCoder Nov 01 '17 at 17:02
  • Thank you for your comment ... I have now created a minimal, complete and verifiable example. – steady_progress Nov 01 '17 at 20:40
  • 1
    The problem is that other manifest files from the jars override the manifest created by IntelliJ IDEA. [See here for details](https://youtrack.jetbrains.com/issue/IDEA-116209#comment=27-656589). I'm also not sure you can package a complex Spring Boot application in a single jar file without special hacks. You may better use Maven fatjar plug-in or some other approach. – CrazyCoder Nov 01 '17 at 20:52

0 Answers0