I\'m trying to execute a Java program from the command line in Windows. Here is my code:
import java.io.File;
import java.io.FileInputStream;
import java.io.
It is easy. If you have saved your file as A.text first thing you should do is save it as A.java. Now it is a Java file.
Now you need to open cmd and set path to you A.java file before compile it. you can refer this for that.
Then you can compile your file using command
javac A.java
Then run it using
java A
So that is how you compile and run a java program in cmd. You can also go through these material that is Java in depth lessons. Lot of things you need to understand in Java is covered there for beginners.