原文:Exception in thread "main" javax.imageio.IIOException: Can't read input file!

最近在做javaweb項目,但是在測試上面的代碼時出現了Exception in thread main javax.imageio.IIOException: Can t read input file 開始時看到這個異常時很是困惑,心想難道路徑錯了 但是我沒有直接輸入路徑而是通過Thread.currentThread .getContextClassLoader .getResource ...

2020-04-28 21:46 0 562 推薦指數:

查看詳情

路徑名導致的異常:javax.imageio.IIOException: Can't read input file!

背景:   寫了一個測試程序,目的是讀取本地的圖片,為其打上水印圖片。在使用過程中總會遇到:javax.imageio.IIOException: Can't read input file!的錯誤,最開始以為是圖片路徑名稱寫的不對,按照網上的提示換成正斜線和反斜線都不行。后來發現問題的原因是 ...

Tue Jan 19 04:22:00 CST 2016 0 32025
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM