wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes How to change the current working directory in eclipse. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to change the current working directory in eclipse." Watch "How to change the current working directory in eclipse." New topic
Author

How to change the current working directory in eclipse.

Chan Ag
Bartender

Joined: Sep 06, 2012
Posts: 839
    
  14
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
Bartender

Joined: Sep 06, 2012
Posts: 839
    
  14
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

Joined: Aug 07, 2007
Posts: 1939
    
  28
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
Bartender

Joined: Sep 06, 2012
Posts: 839
    
  14
Oh yes, it's the same ".." we type while specifying the path. Sorry I got confused.

Thanks for correcting me, Tony.

Chan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to change the current working directory in eclipse.
 
Similar Threads
deployment issue
Web Application Configuration Question
Question related to Classpath when using the java and javac commands.
Servlet
Access is denied error message