JAVA - file not found exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vensriram
    New Member
    • Aug 2010
    • 48

    JAVA - file not found exception

    I am trying to read a file with
    Code:
    FileInputStream fstream = new FileInputStream("file1.txt");
    I have placed the file exactly in the folder where the CLASS File s there. still i get an error saying "The system cannot find the file specified"

    Any suggestions?
  • invers3d
    New Member
    • May 2012
    • 1

    #2
    the file must be placed in "user.dir" folder.
    if you are running in eclipse then its proj home dir.

    Comment

    • keep1to2
      New Member
      • May 2012
      • 4

      #3
      you should give it the project dir and file name

      Comment

      Working...