File not found in Java [duplicate]

If it is a regular file outside a .jar, you are using a relative path. That means, the path to the file is formed from the path where you are calling the file from + the relative path. To make it work, you should invoke java within src folder

Leave a Comment