File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where should file path be?

 
Gulshan Singh
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take it off NetBeans and execute it from the command line.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic