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.
In case your Java class is in some package. Suppose your Java class named ABC.java
is present in com.hello.programs
, then you need to run it with the package name.
Compile it in the usual way:
C:\SimpleJavaProject\src\com\hello\programs > javac ABC.java
But to run it, you need to give the package name and then your java class name:
C:\SimpleJavaProject\src > java com.hello.programs.ABC