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?

Recommended Answers

All 5 Replies

How does the src directory contain a .class file ? That tells us that everything is not in the right place.

On other thoughts, detail your problem if you want my solved threads count to go up, becuase I have a feeling I can solve this problem. It has all the characteristics of one, it is not concerning to Java, it only has limited players (a few files and directories) and on top of it , it looks trivial.

PS : Damn I should nail this one before anyone else does.

no idea how the class file got there, i certainly didnt put it there. all i did was change the directory to Ass_5.

for the program to find the .txt files they should be in the src directory shouldnt they?

i'm not sure what else to say tbh
i dont get how it will work in JCreator, but not from the command window, surely they are the same thing?

> However, the program runs without any problems in JCreator.

Check for possible hardcodings in your Java source files and the .bat files. Do a text search for the old directory name in your project directory and you might just stumble upon something.

no idea how the class file got there, i certainly didnt put it there. all i did was change the directory to Ass_5.

OSes are not habitual of moving files while the CPU is idle. ;)

for the program to find the .txt files they should be in the src directory shouldnt they?

No, they should be in the directory from where your classes are run. Typically in the classes directory.

Check from where your JCreator is running your classes.

wahey i've done it!!! JCreator was running classes from the src directory. just copied the text files across to the classes directory and its working now. thanks for you help, i was starting to panic a bit, i have to hand it in in an hour!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.