
javac: file not found error in Java SOLVED
javac: file not found error in Java SOLVED
How to fix javac: file not found: filename.java Usage: javac options source files is shown
Content
0.4 -> hi everyone in this video i will be showing you
how to solve the error javac file not found your
6.88 -> file name dot java so i'll be showing you three
possibilities why this error is caused so let's
12.4 -> get started so the first thing what you need to
do is you need to go to the folder where you have
16.96 -> your dot java file okay so in my case i am having
this particular folder in desktop and just scroll
24.08 -> down and check whether your file name is properly
given so you need to have your file name without
30.24 -> dot java all right dot java dot txt or any other
extension only the type should be a java file and
36.4 -> you should not have dot java in your file name
itself okay so be careful while naming your file
42.56 -> so the next thing what you can do is you need to
go to the environmental variables all right so
47.04 -> just go to edit the system environment variables
go to environmental variables and here you need
52.64 -> to check both the paths present in user variables
as well as system variables so just click on path
58.72 -> click edit check whether you have specified the
java path okay so i am having that particular path
64.08 -> over here so here you can see you need to specify
this path perfectly java path so do check whether
69.52 -> you have added this path so this is the second way
and the most important of all the reason why i am
76.4 -> getting this error is because this particular
folder is present in desktop but i am trying
81.12 -> to run this program being in some other folder
okay so i need to come to desktop so for that cd
87.6 -> desktop and just hit enter so now i
have come to desktop and now if i run it
94.4 -> yeah this time you can see i'm not getting
any error and it is compiling perfectly
98.96 -> so you can see the output as well so this is how
it works you need to like basically do the three
104.08 -> checks and i think you might have solved the error
now so i hope you have found this video useful
108.72 -> i've also done many other programming videos in
java c c plus plus python node.js react.js blender
114.8 -> sql queries so do check other videos of my
channel subscribe me thanks for watching
Source: https://www.youtube.com/watch?v=ktqKiGQNYKw