What do you do when your program does not run?

j0lly

Platinum Member
Jul 30, 2001
2,885
0
0
I've been trying to get this class to created an object since last night but it's a no go. Java has demoralized me. :(
 

notfred

Lifer
Feb 12, 2001
38,241
4
0


<< What do you do when your program does not run? >>



Fix it so that it does. Compilers have a tendency to include LOTS of debugging features.
 

Zenmervolt

Elite member
Oct 22, 2000
24,514
36
91
Last year when I took C programming (and consequently decided to leave the Info. Sci. program for the Business school) my notebook looked like it had been through a trash compactor because I threw it around the dorm room in frustration so often. Thankfully I didn't have a roommate whom this would annoy. Other than that, I learned the debugging ran me about 2 hours per ten lines of code.

Zenmervolt
 

PrincessGuard

Golden Member
Feb 5, 2001
1,435
0
0
I don't know, it's never happened :)

Seriously though, when a Java program crashes it tells you exactly what the problem is, including line numbers in your source files. If you still need help, you could always post the error message here.

If you're not doing this already, please don't write the entire program all at once without stopping to make sure each individual part works. It's a lot easier to debug 50 lines of code as you're coding, then 500 lines when you're done. I've had to help far too many people who fell into that trap.
 

GigaCluster

Golden Member
Aug 12, 2001
1,762
0
0


<< I learned the debugging ran me about 2 hours per ten lines of code.

Zenmervolt
>>



Come on... I hope you're not serious. Unless A) you're writing something as complicated and sophisticated as Windows, or B) you're debugging someone else's code, 10 lines of code should be debugged within 20 minutes MAX.
If you're like me, then when I write my own C++ code, I know EVERY LINE, and I can just look at a line and explain precisely why it's there and what it does.
I don't know if your instructor put enough weight on this, but comments are extremely important!
 

Jfur

Diamond Member
Jul 9, 2001
6,044
0
0


<<

<< I learned the debugging ran me about 2 hours per ten lines of code.

Zenmervolt
>>



Come on... I hope you're not serious. Unless A) you're writing something as complicated and sophisticated as Windows, or B) you're debugging someone else's code, 10 lines of code should be debugged within 20 minutes MAX.
If you're like me, then when I write my own C++ code, I know EVERY LINE, and I can just look at a line and explain precisely why it's there and what it does.
I don't know if your instructor put enough weight on this, but comments are extremely important!
>>



It may not be Jolly's code at all, but the way the java components are installed on the computer. Java is very picky.
 

j0lly

Platinum Member
Jul 30, 2001
2,885
0
0
Problem solved. :)

It was the compiler (We are required to use a third party compiler called BlueJ for this class). Though one of the methods is not working properly and I am unable to return output outside the compiler (the main method is flawed), I am one step closer to getting it working. :)