In case of run java class file by using batch file you need to create
.bat
file for it.
For create
.bat
file open Notepad and then Type
Java classname
pause
And then save it as
filename.bat
and
now when you click on
filename.bat
file it run and gives output in console window.