making a jar file for console

后端 未结 4 622
春和景丽
春和景丽 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:24

    You need to run your jar file from CLI (command line). Like:

    java -jar yourJar.jar
    pause
    

    If you want to force this, there are different ways to do this:

    • a shortcut file to CMD and your jar as an argument
    • a batch file running your jar using code like mine above
    • calling it from a batch file manually (as I did above)

提交回复
热议问题