Home  >  Article  >  Java  >  Java error The system cannot find the specified file Causes and solutions

Java error The system cannot find the specified file Causes and solutions

尚
Original
2019-12-02 10:28:594890browse

Java error The system cannot find the specified file Causes and solutions

Exception in thread "main" java.io.FileNotFoundException: E:\photo.JPeG (The system cannot find the specified file.) ( Recommendation: java video tutorial)

Then go to the E drive and see that there are files. What’s going on? Then I wonder if the file format is correct, but I see in the directory that it is in jpeg format. no problem.

Later I learned that what is displayed in this place is not necessarily correct. You can display the extension name or open cmd, cd to the file directory and enter dir.
As you can see, the file format in cmd is no longer jpeg.

Java error The system cannot find the specified file Causes and solutions

Changing JPEG to jpg will solve the problem.

Solutions to such problems:

1. Check whether the file name is correct

2. Check whether the file suffix is ​​correct

For more Java knowledge, please Pay attention to the java basic tutorial column.

The above is the detailed content of Java error The system cannot find the specified file Causes and solutions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn