This is to keep the package structure (option P), specify the entry point so that the manifest file contains meaningful information (option e).
#No manifest attribute intellij jar file how to#
jar file, you need to instruct the jar routine on how to pack it. makes the compiler create the directory structure you want. class files ending up with the structure given by the package name use: javac -d. class files in packages, add the package in the beginning of the. A lot of the solutions mentioned here didn’t give me the whole picture, so I’ll try to give you a summary of how to pack jar files from the command line. Hope this helps! Kindly let me know if you still have any issues. the fix is to change the java_home in your shell bash profile to match the java version used to compile the project in eclipse. You might face the unsupported java version error. MainClass eg: java -cp AppleTCRuleAudit.jar .TCRuleAudit Once export the jar file, use the below command to execute. In Java launch configuration, choose your main class. –> This is for the validation that JAR file will have the entry point to the main class.Īfter this, export your Java Dynamic project as “Runnable JAR” file and not JAR file. I spend lot of time to find the fix.ġ.Try restart the Eclipse (if you are using Eclipse to built JAR file) –> Actually this helped my issue in exporting the JAR file properly.Ģ.After eclipse restart, try to see if your eclipse is able to recognize the main class/method by your Java project –> right click –> Run as –> Run configurations –> Main –> click Search button to see if your eclipse is able to lookup for your main class in the JAR file. I faced the same issue and it’s fixed now:) Just follow the below steps and the error could be for anything, but the below steps makes the process smoother.
#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 or Ant:įor CLI, the following command will do: (tks 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