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中的错误吗?