问题
Note, flappyFlyGame is the package that all my class files are in.
I've made a small java project and now I'm trying to export it as a runnable JAR file. However, when I try to run the jar file in the console, I get an error, no main manifest attribute error
, even though I've made a manifest file. Inside it, there's one line, Main-Class: flappyFlyGame.Main
(the class where the main function is). The classes are all .class files. I've run a command in the console, it should be correct (it was identical to others I found online), jar -cvmf manifest.txt gameFile.jar flappyFlyGame
. I've even used Eclipse to generate a jar file, but it says that it can't find the main file. To make sure that it wasn't a project error, I did the same for another insignificant application, with the same results happening. Why doesn't the console recognise or use the manifest file? (I'm not using Maven or anything, by the way.)
Edit: Now answered by dave_thompson_085, I can't mark a comment as an answer though.
来源:https://stackoverflow.com/questions/60403139/getting-an-error-about-the-main-manifest-in-java