making a jar file for console

后端 未结 4 618
春和景丽
春和景丽 2020-12-03 23:30

I have a program without a GUI and I use console! So first I read a line from a user from console

BufferedReader userReader = new BufferedReader(new

4条回答
  •  星月不相逢
    2020-12-04 00:31

    Making an executable jar is the same no matter GUI or not. You need to specify your Main-Class in your META-INF/MANIFEST.MF. See here and and here

    Of course, if you want to start something on the console, just open the console and use the following: java -jar archive.jar (with the above requirements met)

    Then I'd recommend using java.io.Console for reading and writing to the console.

提交回复
热议问题