File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Debugger in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Debugger in Java" Watch "Debugger in Java" New topic

Debugger in Java

K Gupta
Ranch Hand

Joined: Aug 31, 2004
Posts: 43
Hi ,

I want to make a debugger with remote debugging option in Java.Can somebody give some pointers like which API to use and sample code.And I also need to know the theory behind debugging.

If I am destined to fail, then I do have a purpose in my life: To fail my destiny.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Not an advanced question. Please choose an appropriate forum more carefully. Moving...

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15094

The JVM has an interface called JVMTI (Java Virtual Machine Tool Interface) which is the interface you'll want to use if you're going to write a debugger for Java.

You could have a look at the source code for Eclipse or NetBeans, two open-source IDEs which both have very good debuggers built-in.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
There's an excellent standalone debugger called JSwat which you can study. Is there a particular reason you're trying to build one yourself instead of using one of the existing ones? It'll be quite a project.
K Gupta
Ranch Hand

Joined: Aug 31, 2004
Posts: 43
Thanks ...

@Ulf : Yes I know it will be quite a project but I want to make one as I have some specific requirements. Can you guide me toward some theory of debugger i.e how it works etc.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Can you tell us a bit about those special requirements? I am betting that it will be easier to start with something like JSwat and incorporating those than to roll your own from scratch. If those features could be of general interest, the lead developer of JSwat might even help you get them implemented, and incorporate them in the official version.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

Since the Java VM has its own builtin debugger, every development system I know of uses that. Which is reasonable, because about the only other way you'll be able to see inside the system and set breakpoints, etc. is to create (and debug!) your own JVM.

There's no API I'm aware of - the developer tools simply send text debugging commands to the JVM debugger and present what they pull out of the debugger's text responses. Which should mean that telnet is the simplest remote debugger of them all.

BTW, the Unix "ddd" debugger also supports Java in addition to compiled languages. It's a plugin, I think, but I believe it came already enabled in the version of ddd that came with my Fedora Linux distro.

An IDE is no substitute for an Intelligent Developer.
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Tim Holloway:
There's no API I'm aware of

So what would you call the JVMTI ???

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I agree. Here's the link:
subject: Debugger in Java
It's not a secret anymore!