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 which will open cmd and execute my Main.java into command prompt. Easy isn't it, but I have got confused about how?
Below I am writing steps which my batch file should perform
- open cmd
- javac Main.java
- java Main
My file will reside next to all my .java so I am assuming I don't need to give explicit path.
My understanding so far by research:
- open text editor
- write a code to open cmd(Which I am not sure how)
- echo javac Main.java (Which is still fuzzy concept for me)
- echo java Main
Save as: name.bat
Any help will be appreciated. Thank you.