I have a javafx project, I made a jar
file like this: in the project structure I selected Artifacts
– & gt; clicked plus
– & gt; JAR
– & gt; from modules with dependencies
. Next, I indicated where my Main class is. After that, I created a jar
file. I click on it and there is the following error: Error: Invalid or corrupt jarfile
. How to fix it?
File manifest.mf
Manifest-Version: 1.0
Main-Class: Graphics
Project structure:
Answer 1, authority 100%
Generally idea
generates a Manifest
file in the wrong directory. You need to put it in resources
Answer 2, authority 17%
If this error occurs, then you must:
- Move the
META-INF
folder with theMANIFEST.INF
file to theresources
- Press
Build Project (Ctrl + F9)
- After building press
Run (Ctrl + F10)
- Check if your code is executed correctly (in most cases the error disappears)
folder