Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I changed the name of a folder so that it would meet the requirements for my assignment submission and now my program wont run in the command window. its saying it can't find the .txt files.
However, the program runs without any problems in JCreator.
i have a folder called Ass_5 with 3 folders in it - src, files and classes as well as build.bat and run.bat. src has the two .txt files, a class file and the java source file. the other two folders are empty. everything is in the right place isnt it?
So it sounds like the program is running. It is just that it throws an exception that it cannot find your Cities.txt file while it is running.
How are you trying to load that Cities.txt file in your code? Can you post the snippet of the code you are using to load the Cities.txt file? Is that code using a hard coded file path that has your old directory name?
yeah it does run fine, it just wont find the .txt files
Not to nit pick too much, but in programming, detail and precision are very important. So your subject of "...my program won't run" is very different than what is actually happening which is that your program is failing. ;) It's just that that difference makes a huge difference in how to go about troubleshooting the problem. See the Tell The Details FAQ for more info.
Based on the code you have, it is going to look for the txt files in whatever directory the program is started from (unless the user.dir system property is getting set on the command line).
1. Are in the Ass_5 directory when you issue the run command? If not, try changing into that directory and see if it works.
2. I take it that the run.bat file was provided to you by your teacher? Or did you write it?
I have to run to a meeting, so my next reply will be delayed. But someone else might be able to jump in and pick things up to help you.
i've worked out where i've gone wrong now. JCreator was running the classes from the src directory and not the classes directory. i copied the .txt files across to the classes directory and its all working perfectly now.