javac responds with “not a file” but the file exists

前端 未结 1 970
天命终不由人
天命终不由人 2021-01-13 05:16

When I compile one Java file with javac, it responds with the error not a file (instead of file not found):

So I tried to compile

相关标签:
1条回答
  • 2021-01-13 05:56

    In the first image you posted you can see this:

    > dir
    Mode     Name
    -a---l   helloworld.java
    

    So, what that l at the end of the mode means is that helloworld.java is not a file, it's a symlink. And that's what javac is telling you.

    The example you posted in the second image works because that one is actually a file (see the Mode column says -a----).

    The problem is caused by OneDrive, it seems what we see as files are not actually the files but links that point to those files. To avoid the problem, don't place your java files inside the OneDrive folder.

    0 讨论(0)
提交回复
热议问题