Java 选择性目录编译错误

Java Compilation error for selective directories

javac filename.java 不工作 "C:\Users\Idiot\OneDrive\Documents\NiTth Semester\OOP with Java\LAB\DAY_1" 但工作得很好 "D:"

我已经尝试将路径设置为 "C:\Program Files\Java\jdk-12.0.2\bin"

C:\Users\Idiot\OneDrive\Documents\NiTth Semester\OOP with Java\LAB\DAY_1>dir
 Volume in drive C has no label.
 Volume Serial Number is 0ED7-AEA4

 Directory of C:\Users\Idiot\OneDrive\Documents\NiTth Semester\OOP with Java\LAB\DAY_1

02-09-2019  16:13    <DIR>          .
02-09-2019  16:13    <DIR>          ..
02-09-2019  16:28               151 Demo.java
02-09-2019  16:28               187 Factorial.java
02-09-2019  16:28               643 Fibo.java
02-09-2019  16:28               339 Pattern.java
02-09-2019  16:27               235 Temp.java
               5 File(s)          1,555 bytes
               2 Dir(s)  99,578,114,048 bytes free

C:\Users\Idiot\OneDrive\Documents\NiTth Semester\OOP with Java\LAB\DAY_1>javac Demo.java
Demo.java:2: error: error while writing Demo: C:\Users\Idiot\OneDrive\Documents\NiTth Semester\OOP with Java\LAB\DAY_1\Demo.class
class Demo
^
1 error
---------------------
D:\>dir
 Volume in drive D is New Volume
 Volume Serial Number is 92C6-DE71

 Directory of D:\

02-09-2019  16:28               151 Demo.java
02-09-2019  20:18    <DIR>          DOWNLOADS
30-07-2019  22:24    <DIR>          program files
01-09-2019  00:51    <DIR>          SharedFolder
30-07-2019  21:35    <DIR>          Temp
               2 File(s)          1,014 bytes
               5 Dir(s)  175,516,921,856 bytes free

D:\>javac Demo.java

D:\>java Demo
Result : 17

您的用户是否可能没有使用 Java\LAB\DAY_1\ 写入 C:\Users\Idiot\OneDrive\Documents\NiTth Semester\OOP 的权限? 您可以在此目录中手动创建文件吗? 也可能是路径中的空格导致了问题。这些通常应该避免。