I am getting no main manifest attribute while running the jar create by Intellij. I extracted the jar and observed that there was another manifest
Putting the META-INF folder in */resources can do, but is not the way: Intellij just puts all under main/resources or test/resources in the root level of the generated jar, that's why it works; but in a Java project, we usually put them under project root, which is the same level as src. Putting them under "resources" is breaking the convention, besides, they are not resource files.
Make sure you:
MANIFEST.MF file at project root;Include in Project build under "Project structure" -> "Artifacts" panelMETA-INF folder listed in the files to include in the jar, apart from "project compiled output", in the Output Layout tabAnd then, save the settings, build again, and enter "Build" menu to "Build Artifacts..", and "build" the JAR. Check the generated jar again, run with java -jar.