ReventonMC ReventonMC - 1 year ago 96
Java Question

Javac classpath (.java file)

I want to compile a java file from the command line using this command:

javac -cp C:/Java
but it keeps saying that

javac: file not found:
Usage: javac <options> <source files>
use -help for a list of possible options

any help please? ;)enter image description here

Answer Source

run the following code in the terminal to compile the java source code

javac C:/Java/

then to execute the code

java theClassNameOfTheJavaFile