简体   繁体   中英

When I run my jar file nothing happens

I first tried to run my jar file by java -jar test2.jar and got the following error "Failure to load main class Manifest attribute from test2.jar"

after googling stack overflow i came up with a solution saying i needed a manefest file with the nsme of the starting class.
I tried the following

jar cfm app.jar man.txt Now nothing happens, after I type the line the curser just goes to the next line man file looks like Main-Class: cStart

my cstart looks like

public class cStart {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);

         cRiunTest test;
         test=new cRiunTest();
         test.run();

        if (true)
            return;
    }
}

Jar command is to manipulate jar (java archive) files. To run a jar you should use the command java -jar program.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM