![no manifest attribute intellij jar file no manifest attribute intellij jar file](https://miro.medium.com/max/852/0*NfhtRZv32Drn6-Rf.png)
![no manifest attribute intellij jar file no manifest attribute intellij jar file](https://i.stack.imgur.com/XgBs7.png)
Just pick a class and Eclipse will automatically build a cool MANIFEST.MF for you. and nextĪnd you'll see " Select the class of the application entry point". Update: I just found a really neat way to specify the Application’s entry point in eclipse. It’s really a huge mess to specify this attribute inside the MANIFEST.MF file. You get this “no main manifest attribute” error when this line is missing from the MANIFEST.MF file. The main attribute inside the MANIFEST.MF looks like this: Main-Class. Wondering how you could look at what’s inside a jar file? Open the jar file with WinRAR. Inside the jar file, the MANIFEST.MF file is located in META-INF folder. The Main attribute is necessary to tell java which class it should use as the application’s entry point. That is because Java cannot find the Main attribute in the MANIFEST.MF file. Note that jar-with-dependencies should be literally put as, not to be replaced with the jar file names you want to include. In this example all the dependency jars as specified in section will be automatically included in your single jar. (What that class is depends on the program, it’s impossible to tell from the information you’ve supplied).Īlternatively, you can use maven-assembly-plugin, as shown in the below example: Where is the class that contains the main method to run the program. If it’s not an executable JAR, then you’ll need to run the program with something like: java -cp app.jar
#NO MANIFEST ATTRIBUTE INTELLIJ JAR FILE HOW TO#
See Packaging Programs in JAR Files to learn how to create an executable JAR. The -jar option only works if the JAR file is an executable JAR file, which means it must have a manifest file with a Main-Class attribute in it. That should have been java -jar app.jar instead of java -jar "app".
#NO MANIFEST ATTRIBUTE INTELLIJ JAR FILE FULL#
Note that this is only the plugin definition, not the full pom.xml: jar įor Maven, something like the following snippet should do the trick. Note that there are several ways to get this done either with the CLI, Maven, Ant or Gradle:įor CLI, the following command will do: (tks dvvrt) jar cmvf META-INF/MANIFEST.MF. Where 圜lass is the class holding the public static void main(String args) entry point. The file itself should have (at least) this one liner: Main-Class: 圜lass Second, to make a jar executable… you need to jar a file called META-INF/MANIFEST.MF First, it’s kind of weird, to see you run java -jar "app" and not java -jar app.jar