Creating a batch file, for simple javac and java command execution

前端 未结 11 2583
终归单人心
终归单人心 2021-02-15 14:18

It is a really simple thing but I cannot get my head around it. I have looked at plenty of StackOverFlow post and as well as on internet.

My goal is to create a .bat whi

11条回答
  •  -上瘾入骨i
    2021-02-15 14:39

    you want these four lines of code in your Run.bat:

    @echo off          //this makes it so you have an empty cmd window on startup
    javac Main.java    //this compiles the .java into a .class
    java Main          // this runs the .class file
    pause              //this prevents the window from instantly closing after program end
    

提交回复
热议问题