0
在的IntelliJ我,如果只檢查該文件存在在IDE的IntelliJ在Java file.exists()始終返回false
File myFile=new File("myFile.txt");
boolean isExists=myFile.exists();
的isExists始終是假的這個簡單的程序。
如果我嘗試
FileInputStream stream=new FileInputStream(myFile);
它拋出找不到文件的異常
java.io.FileNotFoundException: myFile.txt (The system cannot find the file specified)
我驗證的IntelliJ正在運行的自己,這是作爲一個管理員(我驗證了使用sysinternal工具)
但是,如果我從命令提示符運行編譯的類文件,它的工作原理。
我也嘗試讀取文件的內容,這也從命令提示符工作。
這是intellij中的錯誤嗎?