Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2011
    Rep Power

    Default File IO - where do the txt files need to be located?

    Hey everyone! I'm working on a program that receives the name of a .txt file through Scanner, and it prints out the number of lines that the .txt file has. The problem I'm having is- where does that .txt file need to be located in terms of a directory? It keeps returning errors such as:

    " HeartOfDarkness.txt (No such file or directory)"

    Thanks in advance, any help would be appreciated!!

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Rep Power

    Default Re: File IO - where do the txt files need to be located?

    The files can be anywhere you like. You just have to make sure you have the correct path in your code, either absolute or relative.

Similar Threads

  1. Tomcat Webapps directory located in eclipse
    By ajincoep in forum New To Java
    Replies: 0
    Last Post: 02-18-2011, 07:58 AM
  2. I can't read a text file located inside my jar.
    By Serrano0811 in forum New To Java
    Replies: 1
    Last Post: 04-21-2010, 06:03 PM
  3. Replies: 1
    Last Post: 02-28-2010, 04:06 PM
  4. How to open a file located in server from client side
    By Malathi in forum Web Frameworks
    Replies: 4
    Last Post: 04-20-2009, 10:10 PM
  5. How to read xml file located in local system using Java
    By java_kick in forum Advanced Java
    Replies: 2
    Last Post: 04-07-2009, 12:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts