当前位置: 技术问答>java相关
请问在JDK中如何调试程序??
来源: 互联网 发布时间:2015-04-18
本文导语: 请问在JDK中如何调试程序??拜托!! | 有个jdb的工具 Usage: jdb where options include: -help print out this message and exit -version print out the build...
请问在JDK中如何调试程序??拜托!!
|
有个jdb的工具
Usage: jdb
where options include:
-help print out this message and exit
-version print out the build version and exit
-host host machine of interpreter to attach to
-password password of interpreter to attach to (from -debug)
-dbgtrace print info for debugging jdb
options forwarded to debuggee process:
-D= set a system property
-classpath
list directories in which to look for classes
-X non-standard debuggee VM option
is the name of the class to begin debugging
are the arguments passed to the main() method of
For command help type 'help' at jdb prompt
Usage: jdb
where options include:
-help print out this message and exit
-version print out the build version and exit
-host host machine of interpreter to attach to
-password password of interpreter to attach to (from -debug)
-dbgtrace print info for debugging jdb
options forwarded to debuggee process:
-D= set a system property
-classpath
list directories in which to look for classes
-X non-standard debuggee VM option
is the name of the class to begin debugging
are the arguments passed to the main() method of
For command help type 'help' at jdb prompt
|
以上是UNIX环境底下的,WINDOWS平台上用jdb -h自己看帮助吧。
|
先用jdk/bin/下的javac *.java编译你的程序,然后运行java *即可(* 代表你的程序名称)
|
在dos环境下运行下面的命令:
set path=%path%;/java home/bin
set classpath=%classpath%;.
当然你也可以把上面的命令做成批处理文件
set path=%path%;/java home/bin
set classpath=%classpath%;.
当然你也可以把上面的命令做成批处理文件
|
关于这个,有一本专门的书,不单单讲如何debug,还告诉你很多道理,那就是《java程序调试实用手册》
|
jdb吧,用惯了挺好的,jdk里面有。