javac: file not found: first.java Usage: javac

前端 未结 14 1139
醉梦人生
醉梦人生 2020-12-10 06:42

I have a filename named \"first.java\" saved on my desktop in notepad++. When I run the cmd command \"javac first.java\" it gives me this error.

javac: file          


        
14条回答
  •  一生所求
    2020-12-10 06:47

    First set your path to C:/Program Files/Java/jdk1.8.0/bin in the environment variables. Say, your file is saved in the C: drive Now open the command prompt and move to the directory using c: javac Filename.java java Filename

    Make sure you save the file name as .java.

    If it is saved as a text file name then file not found error results as it cannot the text file.

提交回复
热议问题