Exception in thread "main" java.io.FileNotFoundException: E:\\a (拒絕訪問。)
File src = new File(“E:\\a”);
BufferedReader br = new BufferedReader(new FileReader(src));//報錯的是這行
報錯如下:
Exception in thread “main” java.io.FileNotFoundException: E:\a (拒絕訪問。)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileReader.(FileReader.java:72)
at com.liyu.fileAndIO.IOTest2.main(IOTest2.java:14)
解決思路:當src是資料夾就會報這個錯,因為輸入流不能讀取資料夾,把他換成檔案file就OK。
PS 當你在進行資料夾的複製的時候要檢查程式碼是不是讀取的是資料夾。
相關推薦
Exception in thread "main" java.io.FileNotFoundException: E:\\a (拒絕訪問。)
File src = new File(“E:\\a”); BufferedReader br = new BufferedReader(new FileReader(src));//報錯的是這行 報錯如下: Exception in thread “main” java.io.FileNo
解決java.io.FileNotFoundException: D:\tempfile (拒絕訪問。)
問題:java.io.FileNotFoundException: D:\tempfile (拒絕訪問。)at java.io.FileOutputStream.open(Native Method)at java.io.FileOutputStream.(FileOutp
Java解決java.io.FileNotFoundException: E:\work\work (拒絕訪問。)
一、問題 在使用FileInputStream或FileOutputStream時會遇到如下問題1和問題2。 問題1: java.io.FileNotFoundException: .\xxx\xxx.txt (系統找不到指定的路徑。) at java.io.Fil
Android-開發異常《java.io.FileNotFoundException (Is a directory)》
File file1 = new File(Environment.getExternalStorageDirectory( ).toString()+File.separator +"seantest");//僅建立路徑的File物件 if(!
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
檢查 post source 系統 RM 方法 internal .com 2.6 1、window操作系統的eclipse運行wordcount程序出現如下所示的錯誤: Exception in thread "main" java.lang.Unsatisfied
Hadoop-異常-Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/avro/io/DatumReader
//maven org.apache.avr 下載不完全 ,去maven If you are using maven to build your jar, you need to add the following depende
Exception in thread "main" org.apache.hive.service.cli.HiveSQLException: java.io.IOException: org.
在hive命令列中執行 hive和hbase整合的表 hhh_tj_atmosphere_history 可以正常執行,但是通過java jdbc hiveserver2 就不可以(通過hiveserver2訪問hive自建表就可以,就是不能訪問整合後的表)。 Running:sel
Exception in thread "main" java.lang.NoSuchMethodError: org.testng.TestNG.configure(Lorg/testng/CommandLineArgs;)V
exc and main ini args erro pre 運行 ppc TestNG運行時報以下錯誤: Exception in thread "main" java.lang.NoSuchMethodError: org.testng.TestNG.configur
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
syn sel upd apache date define 出現 eth jre me 的 maven 項目, 右鍵 update dependencies , 出現 錯誤 Exception in thread "main" java.lang.Unsupp
Linux運行Java出現“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”報錯
blog inux ict jar mem car dict enc cnblogs 在運行如下程序時出現“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”
2類型轉換異常:Exception in thread "main" java.lang.ClassCastException:java.lang.Object cannot be cast to java.lang.Integer
cnblogs color pan rgs main string [] 類型 style public class TestException { public static void main(String[] args) { Object obj
Exception in thread "main" java.lang.UnsatisfiedLinkError:
odi ssl time control nat base action ini feel [[email protected]/* */ database]$ ./runInstaller 正在啟動 Oracle Universal Installer.
Exception in thread "main" java.net.BindException: Address already in use: JVM_Bind
next style exception void println clas can color imp 1 import java.io.PrintStream; 2 import java.net.Socket; 3 import java.net.Serve
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/ServletRegistrationBean
cau type main ebean url nag jar except found 異常信息 2017-09-02 18:06:37.223 [main] ERROR o.s.boot.SpringApplication - Application startup
Junit測試出現異常:Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.commons.util.
mage lan release ret 解決方案 common 你會 問題 nbsp 在進行單元測試時,測試出現異常 pom.xml依賴如下 <dependency> <groupId>org.junit.jupiter<
Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name Message, locale zh_CN
bundle 描述 str 圖片 ava thread 進行 sage mis 問題描述:今天在進行程序國際化編程時,碰到MissingResourceException異常,大意是沒有找到屬性文件。當時項目目錄如下: 我把兩個屬性文件放到源碼包下,所以會出現問題。 解決
idea中使用scala運行spark出現Exception in thread "main" java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
lib apache brush inf under tle 配置 erro cal idea中使用scala運行spark出現: Exception in thread "main" java.lang.NoClassDefFoundError: scala/co
windows上react-native run-android時Exception in thread "main" java.lang.IllegalArgumentException: MALFORMED報錯
andro 重新 ive div alt 刪除 ima 用戶 文件夾 報錯如圖 解決 在C:\Users\{用戶名}\.gradle\wrapper\dists路徑下,刪除所有文件夾,重新run-android ps:網上搜了說是說是java解壓縮編碼格式問題什麽的,感覺
Spring Boot 啟動報錯 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37
work 結果 frame getc director inf 中文 getclass post 使用命令 java -jar springBoot.jar 啟動項目,結果報錯如下: Exception in thread "main" java.lang.String
tomcat啟動時,內存溢出,Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
通過 per memory tomcat配置 -xmx ... nbsp ont ron 問題原因 通過tomcat啟動項目,也許是因為項目太大,配置的內存不夠用了。老是報內存溢出的問題。 解決辦法 1.選中項目 右鍵 run as -》Run Configu