Is there any way to compile and run a java file without cmd
? I want to compile and run java source files by clicking a button like in ides.
Can I do that?
Is there any way to compile and run a java file without cmd
? I want to compile and run java source files by clicking a button like in ides.
Can I do that?
there are many options.
for learners it is good to create a batch file(with .bat extension) or use IDE.
simply create a file with anyname.bat and write
javac YourPathToFile\yourClass.java
java YourPathToFile\yourClass
pause;
save it and double click on that file. (make sure your path variable is already set)
If you using Eclipse IDE then Eclipse is automatically compiling your code on the fly.
Or In Eclipse, You can un-check the build automatically in Project menu and then build by hand by type Ctrl + B, or clicking an icon the appears to the right of the printer icon.