aspose file tools*
The moose likes Beginning Java and the fly likes Where should file path be? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Where should file path be?" Watch "Where should file path be?" New topic
Author

Where should file path be?

Gulshan Singh
Ranch Hand

Joined: Apr 22, 2009
Posts: 41
I need to load a text file for my program. It only loads when its the absolute path, like C:\\file.txt. I want to make it so that it loads relative paths, so typing file.txt would load as long as its in the same directory as the program. I'm using Netbeans IDE and I tried putting file.txt by the classes and by the jar file, but it still can't locate the file when using a relative path. What should I do?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39396
    
  28
Take it off NetBeans and execute it from the command line.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where should file path be?