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

How to change the current working directory in eclipse.

 
Chan Ag
Rancher
Posts: 1089
14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My current code has the following line.



When I run the code that has this line, I get the following exception.

Import <something>: ..\logs\UPloaded_31_11_2013_14_38_11.csv (The system cannot find the path specified)
java.io.FileNotFoundException: ..\logs\UPloaded_31_11_2013_14_38_11.csv (The system cannot find the path specified)

I think ".." refers to the current working directory. I want to set my current working directory to a certain directory on my workspace for this project only.

Currently in my run configuration, under the arguments tab, in the working directory field I have this--> Default - $(workspace_loc:<something>_2014)

How can I supply another path in the other field, for example for abc/def/a, what should I specify there?

Thanks,
Chan

Currently for testing my changes, I have changed the above code as

 
Chan Ag
Rancher
Posts: 1089
14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is resolved. The mistake I was doing was, I was appending the dollar sign to the path. Just specifying the path without the dollar sign worked.

 
Tony Docherty
Bartender
Pie
Posts: 2878
59
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know you've already solved this but I thought I'd just add some information based on your original post.

I think ".." refers to the current working directory

No, '..' means go back one level ie move to the parent of the current directory.

Currently in my run configuration, under the arguments tab, in the working directory field I have this--> Default - $(workspace_loc:<something>_2014)

How can I supply another path in the other field, for example for abc/def/a, what should I specify there?

You click on the 'Other' radio button and then specify the directory you want to use as the current working directory.
 
Chan Ag
Rancher
Posts: 1089
14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yes, it's the same ".." we type while specifying the path. Sorry I got confused.

Thanks for correcting me, Tony.

Chan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic