error: file not found: FirstJavaProgram.java Usage: javac <options> <source files> use –help for a list of possible options On jdk 14.04

huangapple go评论101阅读模式
英文:

error: file not found: FirstJavaProgram.java Usage: javac <options> <source files> use --help for a list of possible options On jdk 14.04

问题

我在我的 Windows 10 操作系统上安装了 JDK 14.0.2。我设置了路径和 JAVA_HOME 变量。我还使用 java -versionjavac -version 命令检查了版本,但是当我尝试使用命令行编译简单的程序时,它给我返回了以下错误:

error: 文件未找到: FirstJavaProgram.java
用法: javac <选项> <源文件>
使用 --help 以获取可能选项的列表

我该如何解决这个问题?

英文:

I installed jdk 14.0.2 on my window 10 OS. I set the path and JAVA_HOME variable. I also check Versions using java -version and javac -version but when I try to compile simple program using cmd it gives me the following error:

error: file not found: FirstJavaProgram.java
Usage: javac &lt;options&gt; &lt;source files&gt;
use --help for a list of possible options

How can I resolve this problem?

答案1

得分: 1

为了成功运行 javac FirstJavaProgram.java,你必须在与文件 FirstJavaProgram.java 相同的文件夹中。在执行 javac 命令时,请确保你在该文件夹中。如果不在该文件夹中,请在命令行中使用 cd path\to\the\correct\folder 命令更改到正确文件夹的路径,其中 path\to\the\correct\folder 是你存放 FirstJavaProgram.java 文件的位置,然后再次运行 javac 命令。

英文:

In order to successfully run javac FirstJavaProgram.java you must be in the same folder where the file FirstJavaProgram.java is. Check that you are in that folder when you issue the javac command. If you're not, change your current path in the command line with cd path\to\the\correct\folder where path\to\the\correct\folder is wherever you have your FirstJavaProgram.java file, and then run the javac command again.

huangapple
  • 本文由 发表于 2020年8月27日 16:14:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/63611846.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定