Need help implementing cd command
807588Apr 30 2009 — edited May 1 2009I am writing a command interpreter in Unix that is suppose to run commands like Unix does. I am using Runtime.exec() to run commands such as dir, ls, echo, etc. However exit and cd are not part of those commands. I managed to implement an exit command, but I need help with the cd. Is there a way to change your directory in java just like the cd command does? I've tried System.setproperty("user.dir", path), but it does not seem to work. Typing in dir just shows me all the files that my program is in. I expect it to show me the files that I changed the directory to.