tags:

views:

909

answers:

1

Hello,

In my current project settings, I have configured Eclipse to place the compiled .class files in the /bin directory.

My puzzle is that, when I run the application via the IDE and get it to print the current working directory (System.out.println(System.getProperty("user.dir")) I expect the console output to be /bin - instead the value printed is the projectRoot folder (without the /bin suffix).

If I were to navigate to the /bin folder directly, and execute my java class, the current working directory is printed as I expect it to be. What I would like is the Eclipse IDE to behave similarly.

Any ideas as to why I am observing this disparity? I have gone through many project build settings, but cannot seem to find anything that would cause this anomaly.

Kind regards, Dinuk

+2  A: 
Michael Myers
And if I were VonC, I'd add an appropriate screenshot.
Michael Myers
@mmyers: Thank you so much - I already spent 5 minutes trying to figure what could be causing this, and was afraid I would end up spending the best part of an hour looking for a hidden config setting.Thank you for the prompt response - I'll try to post a more interesting question next time :-)
Dinuk
@mmyers: all right, all right, just gimme a minute ;) +1, by the way
VonC
No, really, that's not the way I meant it. I meant that if I were you, and if I (being you) were posting an answer to this question, I (being you) would include a picture. I didn't mean that if I were you, I (being you) would go and add a picture to mmyers's post. Thanks for adding it, though. :)
Michael Myers
(I'm assuming it illustrates what I said; flickr is blocked by the proxy server here.)
Michael Myers
@mmyers: yes, I figured you meant it the way you just described. I just wanted to tease you a little bit, hence my tongue-in-cheek comment ;)
VonC
darn, flick blocked (just like for me at work, except I am posting this from home). I will check if I find a more accessible illustration.
VonC
... and done (feel free to revert any change you might find inappropriate or not in the spirit of your original answer)
VonC
Looks good to me, thanks!
Michael Myers