- 1
Java file not found in cmd [SOLVED]
Hi friends 🖐🏼 I'm beginner in Java and I installed JDK in win 10. I changed path and JAVA_HOME but when I open cmd and type javac hello.java it shows "file not found". How can I fix this problem?
16 Antworten
+ 5
if it shows file not found instead of command not recogonized then probably java is installed correctly but trying in wrong directory
+ 4
Shakiba Majd please attach anykinda screenshot or the exact message that you are getting so that we could get an idea of whats actually goin on with it
+ 4
Shakiba Majd
probably you have opened your command prompt in wrong place .. just do as follows..
open file explorer and go to the directory in which your file "hello.java" contains ..
affer that in the address bar type cmd
this will open command prompt in that directory
after that try compiling ...
leme see if that works..
please provide a screenshot if that doesn't work too...
+ 4
Martin Taylor
Prashanth Kumar
Quantum
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟
Sakshi Agrawal
Thanks a lot 🙏
It's ok now with your help, cmd has wrong location.
+ 3
Maybe java is not completely installed. You should try to delete the java that is installed on your device, and try to reinstall it. Let the installation gets complete then try to run your code.
+ 1
You have to enter the full current path of the file.
javac full_current_path/hello.java
+ 1
Shakiba Majd What I meant was:
"FULL_CURRENT_PATH"
+ 1
Shakiba Majd
Your Java file name and Class name should be same
+ 1
Shakiba Majd
Open Environment Variable
Select path
Add your JDK path and this path should be like
C://Program Files//java/bin
Then try to compile and run Java class
0
Quantum What does "hole_path" mean?
0
Prashanth Kumar Thanks and how can I fix it?
0
Prashanth Kumar
I get this message:
error: file not found: Hello.java
Usage: javac <options> <source files>
use --help for a list of possible options
0
Quantum I'll try it,thank you🙏
0
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ But both are the same
0
Hello friends I am. Beginner my error : file not found :java code