Debug challenge: how do you debug a Java program?
Many times we have to debug our programs (when not using an IDE). So the first question here is:
- How do you debug a Java program (without using an IDE)?
Now that's a very simple question... the next two are a little more interesting:
- How do you turn the debug on and off within your Java program ?
- How do you turn the debug on and off without recomipiling the java program?
OK... now the purpose of these questions are for those who don't know the answers and want to post they're thoughts/ideas/concepts/brain storms/light bulbs/etc.
This idea was suggested by MC:
So there you have it... have fun.
I was thinking up of something and I think I have an idea... How about say for example if some one is a begginer, just like I am. You guyz can post up a thread that asks us to make programs.
java assertions & log4j.properties
1) Java assertions ( by mistake I typed accertions in my previous post)
2) a) easily you can configure log4j-1.3alpha0.jar , log4j.properties file and
b) org.apache.log4j.Logger logs = Logger.getLogger(MyJavaFile.class);
logs.info(" this is info log");
logs.debug(" this debug logs");
(all the System.out.pritnln() can be used in log.info() example
logs.info(" user name "+username); ect...)
in log4j.properties you can specify : log4j.rootLogger=INFO
3) for beginners we can suggest IDE itself.