简体   繁体   English

Ubuntu 18.04 LTS 中的“错误:找不到文件”

[英]“Error: File Not Found” in Ubuntu 18.04 LTS

So my Ubuntu terminal is claiming that the java file I'm trying to run does not exist.所以我的 Ubuntu 终端声称我试图运行的 java 文件不存在。 However, it clearly does, and it looks like I'm in the right directory.但是,它显然确实如此,而且看起来我在正确的目录中。 Here's what I'm trying to compile这是我要编译的内容

试图编译这个突出显示的 java 文件;看起来我在正确的目录中

And here's what happens这就是发生的事情

Can anybody help me with this?有人可以帮我吗?

If you are sure that you are in the right directory, BE SURE that you write the filename Exactly as what it is.如果您确定您在正确的目录中,请确保您写的文件名完全一样。 Because Linux is case sensitive and for example, if you have a file with name "Sample" and you try to open "sample" file, you will get the error.因为Linux 区分大小写,例如,如果您有一个名为“Sample”的文件并且您尝试打开“sample”文件,您将收到错误消息。

if you type manually, try to use Tab button in your keyboard.如果您手动键入,请尝试使用键盘中的Tab 按钮 it will auto-Complete the file/dir name for you.它将为您自动完成文件/目录名称。 With this way, if you have typo or wrong spelling, Tab does not complete the name and you will know that there is something wrong with what you type in terminal.这样,如果您有错字或拼写错误,Tab 不会完成名称,您将知道您在终端中输入的内容有问题。

Another comment suggested that I use "ls" to see if the terminal can see the file.另一条评论建议我使用“ls”来查看终端是否可以看到该文件。 I got a permission denied error, and used我得到一个权限被拒绝错误,并使用

find.寻找。 -type d -exec chmod 755 {} \; -type d -exec chmod 755 {} \;

to resolve this.解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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