Thursday, July 28, 2011

Remote Debugging Java Applications

After my previous article about Remote Debugging .NET Applications using Visual Studio 2010, I was curious to see how Remote Debugging works for Java Applications. This blog post covers Remote Debugging Java Applications using NetBeans 7.0.

The basic concepts of Remote Debugging are the same for .NET and Java but the process of setting up the host and remote computers varies between Visual Studio and NetBeans. Similar to the .NET application used in the previous post, the screen shots correspond to a simple Java application which would popup a MessageDialog on a button click. Get the code here.

Before configuring the host and remote computers, it is vital to understand the Java Platform Debugger Architecture (JPDA). JPDA provides the infrastructure you need to build end-user debugger applications for the Java Platform. It includes the following APIs broken into three layers -

  • Java Debug Interface (JDI), a high-level Java programming language interface including support for remote debugging
  • Java Debug Wire Protocol (JDWP), which defines the format of information and requests transferred between the process being debugged and the debugger front end
  • JVM Tools Interface (JVM TI), which is a low-level native interface that defines the services a JVM provides for tools such debuggers and profilers

Configuring the Remote Computer

Run the Java application using the -Xdebug and -Xrunjdwp options from the command line.

java -Xdebug -Xrunjdwp:transport=dt_socket,address=6000,server=y -jar RemoteDebugging.jar

Here's a description of the options of the java command -

Option
Description
-Xdebug Enables debugging support in the VM
-Xrunjdwp Loads in-process debugging libraries and specifies the kind of connection to be made

The -Xrunjdwp option has several sub options. Here are the descriptions of the ones that are used above -

Option
Description
transport Name of the transport to user in connecting to debugger application
address Transport address for the connection
If server=n, attempt to attach to debugger application at this address
If server=y, listen for a connection at this address
server If y, listen for a debugger application to attach
If n, attach to the debugger application at the specified address

By default the application starts in suspended mode. In suspended mode the application waits for a debugger to attach itself to the server at the specified port before the application starts.

Configuring the Host Computer

The host computer is the system running NetBeans 7.0. Open the code of the application in NetBeans and select "Attach Debugger". Specify the Connector as SocketAttach, the Host as the hostname of the remote system and the Transport and Port as specified above.

Specify the breakpoints in the code and they would hit appropriately. There are two major bottlenecks in Remote Debugging -

  • The code from which the executable was built should be available at the time of debugging
  • Applications cannot be configured for Remote Debugging at runtime. The -Xdebug option must be specified at the instantiation of the application, making debugging live production code difficult

Before I conclude, here's an article from OTN (Oracle Technology Network) on the Java Platform Debugger Architecture. Visit it if you would like a deeper insight into Java Debugging. The schematic of the JPDA is from a weblog, check it out here.

57 comments:

Javin @ Java Enum tutorial said...

Nice post, completely agree Eclipse is just fantastic, its ability to allow remote debugging in eclipse for java development is simply fantastic. I have also blogged my eclipse experience as 10 tips on java debugging with eclipse ,let me know how do you find it.

Android app developers said...

This is one of the classic and good post.I like your blog explanation.This is one of the user friendly post.

Unknown said...

Thanks for sharing this informative blog..

J2EE Training in Chennai

Unknown said...

Java training
Nice blog, here I had an opportunity to learn something new in my interested domain. I have an expectation about your future post so please keep updates.
JAVA Training in Chennai

geethu said...

This article is very interesting about programming.
Best Java Training Institute in Chennai .

Bay Max said...

Excellent post.It was good and quite interesting.Thanks for sharing this valuable post.Keep sharing.
Regards

Best Informatica Training in chennai
| Informatica training center in chennai

navya said...

I have read your blog its very attractive and impressive. I like it your blog.

.Net Training in Chennai | .Net Online Training | Dot Net Training in Chennai

Dot Net Online Training | LINQ Online Training

Unknown said...

I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle.
Software Testing Training in Chennai

Aptron said...

Nice post!! Thanks for sharing. This is informative and really useful for me.

Loadrunner Training Institute in Delhi
Best Magma Training in Delhi
Mobile and Database Training Institutes in Delhi

meenumaga said...

Very nice post here thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
Business Tax Return
Cpa Tax Accountant
Tax Return Services

Unknown said...

Really helpful and I would like to read more about Java. Keep up the good work and continue sharing.
Angularjs Training Chennai | Angularjs courses in Chennai | Angular 4 Training in Chennai

Unknown said...

Great.Nice information.It is more useful and knowledgeable. Thanks for sharing keep going on and I expect more blog like this



Cloud Computing Training in Chennai

Unknown said...

Nice post!!

Hadoop Training in Chennai

Unknown said...

Great information....


VMware Training in Chennai

Anonymous said...

Nice information.
Angular 4 Training in Chennai | AngularJS Training Chennai | AngularJS Courses in Chennai

LindaJasmine said...

Amazing Blog.The content is very useful. Pls update more.
Angularjs Training in Chennai
Angularjs course in Chennai
Angular 2 Training in Chennai
Angular 4 Training in Chennai
Angular Training in Chennai

LindaJasmine said...

Awesome Post! The contents prove that you have indepth knowledge on the subject. Thanks for sharing. Waiting for more updates from you.

Best Informatica Training in Chennai
Informatica course in Chennai
Informatica Training center in Chennai
Informatica Training chennai
Informatica Training institutes in Chennai
Informatica Courses in Velachery
Informatica Courses in Tambaram
Informatica Courses in Adyar

mathimathi said...

I love signs too. You make some pretty cute ones. Have a great week end.
SEO Training in Chennai |
SEO Training |
SEO Course in Chennai

mathimathi said...

I love it...and all your signs too.
ccna Training in Chennai |
ccna course in Chennai |
ccna Training institute in Chennai

gowthunan said...

I was curious if you ever considered changing the layout of your site? It’s very well written; I love what you’ve got to say
industrial safety courses in chennai

Rithi Rawat said...

Outstanding blog thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.

Check out : machine learning training in chennai
artificial intelligence and machine learning course in chennai
Big Data Hadoop Training in Chennai a
Hadoop Big Data Training

james said...

thanks and nice to see seo services in bangalore seo services in pune

Aruna Ram said...

This blog is awesome! In this post is very interesting for all readers and I am waiting for your more post from this blog admin.
Embedded System Course Chennai
Embedded Course in chennai
Power BI Training in Chennai
Tableau Training in Chennai
Pega Training in Chennai
Excel Training in Chennai
Corporate Training in Chennai
Embedded System Course Chennai
Embedded Training in Chennai

sheela rajesh said...

This blog is full of innovative ideas and i really like your informations.please add more details in future.
Python Training in Chennai
Python Training in T.Nagar
JAVA Training in Chennai
Big data training in chennai
Selenium Training in Chennai
Python Training in Chennai
Python Training in Tambaram

Anbarasan14 said...

Excellent post. Thanks a lot to the author of this post for sharing this with us.

Spoken English Classes in Chennai
Spoken English in Chennai
Top 10 Spoken English Classes in Chennai
Best IELTS Coaching in Chennai
IELTS Coaching Centre in Chennai
English Classes in Mumbai
English Speaking Classes in Mumbai
Best IELTS Coaching in Mumbai
IELTS Coaching in Mumbai
Spoken English Classes in Anna Nagar

Vijay said said...

keep share.

selenium training in chennai
internships in chennai for cse students 2019
internship in bangalore for ece students
inplant training

Indhu said...

Wonderful information with useful stuffs
SAP ABAP Training in Chennai
SAP FICO Training in Chennai
SAP MM Training in Chennai
SAP SD Training in Chennai
SAP Training in Chennai

Unknown said...

Hey.. I checked your blog its really useful.. Provides lot of information..

Do check my blogs also

https://exploring2gether.com/fascinating-places-near-dehradun/

Hardik Mitra said...

hey...It is highly comprehensive and elaborated. Thanks for sharing!

Localebazar- Your single guide for exploring delicious foods, travel diaries and fitness stories.

Visit us for more- localebazar.com

Anand Shankar said...
This comment has been removed by the author.
Personality Development Classes said...

Fine way of telling, and pleasant post. Nice info! Thanks a lot for sharing it, that’s truly has added a lot to our knowledge about this topic. Have a more successful day. Amazing write-up, always find something interesting.
Thanks

prerna mehta said...

Wonderful information! It was very informative. keep sharing it will help others too.
if you want to learn French Lanaguage you can vist us at https://www.classesofprofessionals.com/french-language-institute-delhi

prerna mehta said...


Thanks For writing such great content and help us to learn much more.
Please visit my content on Digital Marketing in Karol Bagh and share your review.

Thanks in Advance

prerna mehta said...


Thanks For writing such great content and help us to learn much more.
Please visit my content on Digital Marketing in Karol Bagh and share your review.

Thanks in Advance

Sakshi Sharma said...


it was great experience after reading this. thanks for sharing such good stuff with us.
i also wrote on makeup course in Delhi.
Please share your reviews.

Sakshi Sharma said...

Thanks for sharing such a good content with us. keep share these kind of content.i I would like to read more.
please review my writeup too -
Digital Marking Course in Patel Nagar

svrtechnologies said...

Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing such an useful info...

sap fico online training
sap fico training videos

SAP Academy said...

Superb Article with all sort of information...
SAP Training in Chennai
Java Training in Chennai
CCNA Training in Chennai
Pearson Vue Exam Center in Chennai
QTP Training in Chennai
Selenium Training in Chennai
Hardware and Networking Training in Chennai
SAP ABAP Training in Chennai
SAP FICO Training in Chennai
AWS Training in Chennai

svrtechnologies said...

This is so elegant and logical and clearly explained. Brilliantly goes through what could be a complex process and makes it obvious..

sap workflow tutorial

Anonymous said...

With regards to Magento shopping basket, clients perusing your store can have a review about their own shopping basket. In the mean time, Magento 2 permits store administrators to adjust the quantity of items when they have been marked as a request.
magento 2 tutorial
magento wish list
magento shopping cart

TIC Academy said...

Informative and nice blog post. Thanks for this wonderful Post.
SAP Training in Chennai
AWS Training in Chennai
Hardware and Networking Training in Chennai
QTP Training in Chennai
CCNA Training in Chennai

Younity said...

The one who does business and takes the responsibility of all the profits and losses is known as entrepreneurs. Here are tips on how to be an entrepreneur.

For More Info Visit:-https://younity.in/2020/06/05/how-to-be-an-entrepreneur/

Mithun said...

Awesome Post.
Java Training in Chennai | Java Training Institute in Chennai | Java Training Center in Chennai | Best Java Training in Chennai | Java Training

Mithun said...

Wonderful Post.
Excellent Post.
CCNA Training
Java Training
AWS Training
PHP Training
Android Training
Oracle Training
Selenium Training
Hardware and Networking Training
SAP Training
Software Testing Training

Ishu Sathya said...

Read your blog, Excellent content written on
"Remote Debugging Java Applications"

If you are looking for RPA related job with unexpected Pay, then visit below link

RPA Training in Chennai
RPA course in Chennai
RPA course
RPA Training in Velachery
RPA Training
Robotic Process Automation Training
Robotic Process Automation Training in Chennai
Robotic Process Automation Courses
RPA Classes in Chennai
Robotic Process Automation Certification

Toppers Mind said...

Nice Article. I always wanted to learn Dot Net Programming. but still not been able to Learn Yet.
Judiciary Classes

suresh said...

Nice Article! Mostly I have gathered knowledge from the blogger, because its provides more information over the books & here I can get more experienced skills from the professional, thanks for taking your to discussing this topic.
DevOps Training in Chennai

DevOps Course in Chennai

Prachi Khattar said...

awesome content you have shared on your blog
you can check our GYC silicon straps high quality printing premium looking bands straps compatible for Mi Xiomi BAND 3 BAND 4. Click on the link given below

CLICK HERE
CLICK HERE
CLICK HERE
CLICK HERE

aspire world immigration said...

I read a lot of blog posts and I never heard of such a topic. I love the subject you have done about bloggers. Very simple. I am also writing a blog related to the best visa consultants, process and application. You can also see this.
Visa Consultant in Delhi

searchkarlo said...


how do i cancel my norton subscription

how to fix canon printer printing blank images

aspire world immigration said...

Thanks for sharing great content with us. I like reading your site's content more. I appreciate your writing skills and the way you are written. I am also a content writer and writing about a Malta work permit, please check and review that.

aspire world immigration said...

I just like the helpful information you provide in your articles. I will bookmark your blog and take a look at it once more here regularly.
I am somewhat certain I’ll be informed of plenty of new stuff right here! Good luck with the following! please check and review the best visa Consultants in Delhi

aspire world immigration said...

Hey ,

Great Job . You Know what ?

I read a lot of blog posts and I never heard of such a topic. I love the subject you have done about bloggers. Very simple. I am also writing a blog related to the ielts online coaching. You can also see this.

clasesofproessioanl said...

What a fantastic post! This is so chock full if useful information I can't wait to dig deep and start utilizing the resources you have given me. your exuberance is refreshing

you've outdone yourself this time

This is probably the best, most concise step by step guide i've evere seen on how to build a successful blog. i am also writing blog about the kindly review it personality development classes.

periyannan said...

This blog is nicely written and I found the content and information very informative as well as helpful.

artificial intelligence internship | best final year projects for cse | internship certificate online | internship for mba finance students | internship meaning in tamil

Joseph Vijay said...

Very Informative post. Thank you for sharing with us.
How to make a paper airplane | Origami paper plane

Farah Noor said...

PUBG PC Download 2023 Cracked Full Version For Windows Latest: PUBG PC Keygen and also to get to a more secure region. The studio room that created this ideal .PUBG PC 2023 Crack