no main manifest attribute, in jar while trying to create and run with console

416 Views Asked by At

I'm trying to create a jar file with console and run it on windows.

Export.java

public class Export {
    public static void main(String[] args) {
        System.out.println("Hello world :D");
    }
}

then I created the class file Running

C:\Users\inod.jayakody\eclipse-workspace\Program>javac Export.java

added the following manifest.mf file in the same folder containing

MANIFEST.MF

Main-Class: Export

created the jar file in cmd using

C:\Users\inod.jayakody\eclipse-workspace\Program>jar cmvf MANIFEST.MF Inod.jar *.class
added manifest
adding: Export.class(in = 524) (out= 336)(deflated 35%)

but when I'm running the file I'm getting following error am I doing anything wrong? what is the issue here?

C:\Users\inod.jayakody\eclipse-workspace\Program>java -jar Inod.jar
no main manifest attribute, in Inod.jar
0

There are 0 best solutions below