简体   繁体   中英

javac : file not found even after settinh HOME_PATH

I have checked for the java -version and javac -version , both work , even running javac works , but when I try to run java file , saved on notepad shows javac : file not found !! I have added both the jdk and jre to the HOME_PATH too. 在此处输入图片说明

also if not with username.. 在此处输入图片说明

now the file.. 在此处输入图片说明 在此处输入图片说明

also the file is saved correctly ie, its a java file with .java and not .java.txt or anything else! 在此处输入图片说明

also i have checked for the echo %PATH% and it does contain the java jdk ,and jre link.. 在此处输入图片说明

Please help me solve this issue, thank you

It seems you're accessing file from incorrect location.

Your file seems to be in D:\\ directory. See the "Location" in file properties dialog.

将目录更改为.java文件所在的位置。

ok now i understand it!! thank you By setting HOME_PATH am just making it so that javac can run from any directory without having me to set path for it again and again each time i use different directories, but to run the program , i will have to be in the same directory in which my java file is present. By set HOME_PATH or PATH i am only skipping the step where i set path for java idk to run javac!! in that directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM