Forums Register Login

compile errors

+Pie Number of slices to send: Send
Programming can tire out a person. My compiler almost never works. How do I know what errors are in my sourcefile? Since the compiler never shows the errors how are my supposed to know what section of the code my bug is?
Is there a solution to finding out bugs without using IDEs? I am still a very beginner novice.

[ case of subject changed -ds ]
[ September 24, 2004: Message edited by: Dirk Schreckmann ]
+Pie Number of slices to send: Send
 

My compiler almost never works.


No offence.. but I don't think it's your compiler that has a problem
(unless you've made it yourselfe)

How do I know what errors are in my sourcefile?



Take a look at the output of your compiler!

Give me an example of what your compiler says, and I'll reply
back.
+Pie Number of slices to send: Send
Learning to understand compiler errors is a very good skill to master, and it should be one of the first things a new Java developer learns to do.

When you're looking at the compiler errors, concentrate on the very first thing the compiler complained about. The message generally includes good information about the error encountered, including on what line number the problem was encountered.

If you happen to have more compiler errors than fits in your console buffer (so you can't just scroll up to look at the first thing output), then you can direct output to a text file, instead of to the console. The following command direct the output to the file results.txt.

javac Foo.java > results.txt

I program in baby steps. I use a fancy IDE that checks my syntax constantly. So, I don't write more than one or two lines of code without knowing that what I'm working on will compile. Even if you're using a simple development environment, using notepad to edit and the command line to compile, I recommend that you do the same thing. Write one or two lines of code, and then see if it compiles. You'll get quick at it, especially if you learn a few keyboard short cuts. (If you're on Windows, Alt+Tab switches between program windows. At the command prompt, you can use the up and down arrow keys to browse through recent commands.)

As Svend noted, feel free to post relevant error messages and code examples. Many folks around here will be glad to nudge you in the right direction.
[ September 24, 2004: Message edited by: Dirk Schreckmann ]
Do you pee on your compost? Does this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 536 times.
Similar Threads
Which eat method and why ??
cleared scjp 5.0 with 100%
RMI remote access error
java.lang.Error: Unresolved compilation problem:
Head First Java
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:56:32.