Java eclipse referencing files in project using relative paths -


i trying upload web using 1 of apache's client libraries. having trouble locating resource file upload. project setup looks this:

root/src/a/b/c/d/program.java

root/resource/resourcefile.txt

i wondering string path referencing resource file program.java?

file f = new file("what path go here?");

thanks in advance.

  • eclipse (by default) not include file in built project.
  • the project path information eclipse environment not available in built project

if run in eclipse, display base path of application.

find out with

file f = new file("."); system.out.println(f.getabsolutepath()); 

tips :

  1. read documentation of java api
  2. for questions write minmal test programs

Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -