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

前端 未结 14 1135
醉梦人生
醉梦人生 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条回答
  •  -上瘾入骨i
    2020-12-10 06:55

    Here is the way I executed the program without environment variable configured.

    Java file execution procedure: After you saved a file MyFirstJavaProgram.java

    Enter the whole Path of "Javac" followed by java file For executing output Path of followed by comment <-cp> followed by followed by

    Given below is the example of execution

    C:\Program Files\Java\jdk1.8.0_101\bin>javac C:\Sample\MyFirstJavaProgram2.java C:\Program Files\Java\jdk1.8.0_101\bin>java -cp C:\Sample MyFirstJavaProgram2 Hello World

提交回复
热议问题