After downloading and setting up the jdk/javac path, I want to be able to manually compile a class file through the command prompt. However, this is what my cmd window looks like after I check for the version to see if the path is set, then try to compile a small class file from Intellij.
C:\Users\goel>java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
C:\Users\goel>javac Main.java
error: file not found: Main.java
Usage: javac <options> <source files>
use --help for a list of possible options
The file is on the computer, and after the first failed try I also copied it to the desktop. Any help on how to fix this would be great.
You need to run javac
command from your project folder where Main.java
file exists. From error you can see that there is no Main.java
file in C:\Users\goel
folder. Change the folder with command:
cd /d <path_to_folder_with_Main.java_file>