Monday, February 16, 2015

JDebug - A Java Debugging plugin for Sublime Text

Debugging is a painful art. The programmers(coders) know about it. Even perfectly written code may misbehave sometimes and it is difficult to identify the piece of code causing the issue just by log statements. So the only possible way to identify the issue is to do step by step debugging of the code dynamically. There are so many debugging tools available for Java, some are standalone and few are integrated within the IDE like Eclipse. In this article, I will show you how to debug java codes remotely using JDebug in Sublime Text.

Setting up Sublime Text

JDebug plugin can be installed using Package Control or manually. I will show you how to install JDebug plugin using Package Control. If you haven’t install the Package Control, you can install packages by installing package control.
Once you have the package control installed, you should start Sublime Text. Open up the command palette from the Preferences --> Package Control menu and search for “Install Package”.

Now you can search for any package you like. In our case, we are going to search for the package “JDebug”.

Setting up JDebug

Setting up JDebug is very simple as it has only few settings to start with. You can copy and paste the default settings into user settings and update the following settings based on your environment.

  • workingdir -     You need to set your current project directory like c:/worksapce/TestService (Windows) or /home/user/abc/workspace/TestService (Linux or Ubuntu)
  • commandline -     Set the jdb command with arguments. If JDK/bin is not in your environment PATH then you need to specify full path to the jdb command. Also change the hostname and port in which the java application service is running and listening.
  • sourcepath -     The path to the source file with in the project. For ant project it usually /src/ and for maven usually /src/main/java.


Ready to set the breakpoint?. Breakpoints are the way to inform the jvm to halt the execution at a particular point (line number or method in a class). When the execution halts, the application variables can be inspected.
Add a breakpoint using 'Toggle Breakpoint' menu option from context menu. Context menu can be accessible using right click. A circle icon will be placed on the line number gutter when a breakpoint is added

When the jvm hits the breakpoint during the execution, the gutter icon will be changed to 'pointer' to indicate that the breakpoint is hit.

Watch Expressions

Expressions can be evaluated using the 'Add Expression' context menu. You can enter any valid expression to evaluate.

Enter the Expression

JDebug Variables

It is interesting to watch the variables in the 'JDebug Variables' window. If a variable is complex object it will be displayed with '+' icon on gutter. These variables can be expanded further to get the additional details using 'Expand' context menu. The 'Expand' context menu will be enabled only in 'JDebug' variables window.

How to Continue?

The application execution can be continued using one of the following menu options
  • Step Over Continue execution to next line
  • Step Into Continue the execution into a method call
  • Step Out Step out of the current method and continue
  • Continue Continue to next breakpoint or till completion


  1. This is awesome. As always great work Senthil

  2. This comment has been removed by the author.

  3. You could give a real example of how to set up, I am newbie in using "Sublime Text"!
    I have only one working folder in c: \ JavaApp \. Alli am making practice and need to use jDebug to see how they change the values of the variables.
    Thank You.

  4. Java developers will find this kit handy as it lets you test the compatibility of your projects with reference to Java specifications. Sun open-source, can now have access to their Compatibility Kit related to Java development technology.

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

      Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

      Java Online Training Java Online Training Core Java 8 Training in Chennai Java 8 Training in Chennai JavaEE Training in Chennai Java EE Training in Chennai

  5. How do you determine the hostname and port in the commandline setting?

  6. This comment has been removed by the author.

    1. Hibernate Online Training Hibernate Online Training Hibernate Training in Chennai Hibernate Training in Chennai Java Online Training Java Online Training

      Hibernate Training Institutes in ChennaiHibernate Training Institutes in Chennai Java Online Training Java Online Training

  7. Hibernate and spring are the frameworks of Java. A java developer should be well aware of these frameworks in order to master the technology and work efficeiently.
    spring training in chennai | hibernate training in chennai
    FITA Academy reviews

  8. Java is the most robust secured and multi threaded programming language which is the reason why most the the developers go for java. A single java code can be used for various platforms.
    JAVA training in chennai | java training institutes in chennai | FITA Academy Chennai

  9. The best thing about HTML5 is that it allows the developers to embed the video files, audio files, and high quality graphics without any third party applications.
    html5 training in chennai | html5 training institutes in chennai | FITA Academy reviews

  10. Hi, actually I'am new to angularJs and infact I'am learning angularjs with online training. I'am having doubt, if you could solve the doubt for me that would be very helpful. The doubt is, how can I reset a “$timeout”, and disable a “$watch()”?
    angularjs training in Chennai | angularjs training | angularjs training Chennai

  11. The main thing which i like about web designing is that it needs creativity and we need to work differently acccording to our clients need this needs a creativity and innovation.
    web designing course in chennai | web designing training in chennai | web designing courses in chennai

  12. Oracle database management system is a very secure and reliable platform for storing database and secured information.Due its reliable and trustworthy factor oracle DBA is famous all around the globe and is prefered by many large MNC which are using database management system.
    oracle training in Chennai | oracle dba training in chennai | oracle training institutes in chennai

  13. I really similar to my spouse and i have bookmarked the internet blog. The item seems to be able to possibly be very interesting. it is advisable to keep uploading added with future with regard to all involving us. Contact Page

  14. Spring is an open source framework which is mainly used in java applications that can be deployed in standalone platform.
    spring training in chennai | spring course in chennai

  15. Excellent post. Keep sharing such a useful post.

    SEO Services in Chennai

  16. The blog you presented was very nice and interesting which helped me to get update on the recent technologies.
    Angularjs training in chennai | Angularjs course in Chennai

  17. Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info! , Regards, servicenow training in hyderabad

  18. Your blog content is really very informative and unique. Thanks for sharing the valuable blog. Core Java Training | Dot Net Training

  19. Sublime Text and setting up its break up point is really a dedious one to go through, You made it simple to understand. Thanks for the post. Good Work
    AngularJS Training Institute in Chennai | Best AngularJS Training in Chennai | AngularJS training and placement

  20. how can i determine the hostname and port for commandline?

    1. The hostname is where your application server like tomcat, jboss, weblogic or webshpere is running. The port is specify as debug port in the application server startup command

  21. Much obliged to you for magnificent data I was looking for this information for my main goal.
    Regards,AngularJS Training in Chennai

  22. Nice information about java debugging plugin Thanks for sharing it
    Java Training in Chennai

  23. This article provides the information about Java its key features and scope for java professionals. This information is really helpful me to know more about Java programming language. Java Training in Chennai | Java Training | Java Course in Chennai

  24. This is my first visit to your blog, your post made productive reading, thank you. Java Training in Chennai

  25. Attractive blog post! I should read from some useful news for this blog section, It 's a great content Keep it useful sharing.
    Selenium Training in Chennai
    selenium training institute in chennai
    best angularjs training in chennai
    angularjs training institute in chennai

  26. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharng this information,this is useful to me...
    Android training in chennai
    Ios training in chennai

  27. Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
    Web Design Company
    Web Development Company

  28. Great put Good stuff.All the topics were explained quickly understand for me.I am waiting for your next fantastic blog

    Core Java Online Training

  29. Really very informative post you shared here. Keep sharing this type of informative blog. If anyone wants to become a Java professional learn Java Training in Bangalore. Nowadays Java has tons of job opportunities for all professionals.

  30. I believe I set it up all correctly, and I can see the program waiting for the me to take the next step or release the breakpoint, but I never get the 'arrow icon' on my breakpoint through sublime.
    If I tell JDebug to stop debugging the program continues happily. Can somebody help me out?

  31. This article provides the information about Java its key features and scope for java professionals. This information is really helpful me to know more about Java programming language. Anybody want to build your own website

    White Label Website Builder

  32. Thanks for your informative blog!!! Your article helped me to understand the future of Core Java programming language. Keep on updating your with such awesome information.

    White Label Website Builder

  33. SV Soft Solutions is offering best Java online training with 100% job assistance and high quality training facilities and well expert faculty .
    to Register you free demo please visit Java Online Training Institute with Job Support

  34. If you are looking for spring hibernate training institute in chennai then candid training is the best place to learn.

    Candid gives you best in class spring hibernate training with high quality and post training support, We provide you free demo session and candid promises the permanent trainer throughout your session and focus on more practical.

    candid training

  35. I'm trying to setup Jdebugger with Grails project. Jdebug says that jdb is attached, but Grails keeps waiting for more commands (a 'run' maybe?). Can you give any help for Grails setup? I've set following with no success:

    "workingdir": "Code/git/project/",
    "commandline": "jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5005 -launch",
    "sourcepath": "/target/work/",
    "debug": true

    1. Hi Niko

      My settings are below and using Windows OS. TestService is my project directory which has the 'src' directory. You need to specify the base working directory and source_path_prefix if you have any.

      "workingdir": "C:/Workspace/TestService",
      "source_path_prefix": "/src/",

      In simple workingdir + source_path_prefix should point to the path where you have the java file or base package name

      My Project Structure (Windows)

    2. Thanks for helping. I still cannot get it to work. If I start my Grails app with grails 'run-app --debug-fork', it waits for jdb to connect. When I connect jdb using 'jdb -attach 5005' or 'jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5005', the grails app continues and I can start using jdb aswell - All good! However, if I set those same commands to Jdebug commandline-config, the grails app keeps waiting for something. Jdebug continue-command in command menu is passive. In Jdebug console it says

      ## Attaching JDB... ##
      ## JDB Attached ##
      -> stop at

      Do you have any more ideas I could try to get it to work?

  36. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.

    Best Java Training Institute Chennai

    Java Training Institute Bangalore

  37. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…

    software testing course in chennai

  38. Existing without the answers to the difficulties you’ve sorted out through this guide is a critical case, as well as the kind which could have badly affected my entire career if I had not discovered your website.

  39. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.

    Hadoop Training in Chennai

  40. Ciitnoida provides Core and java training institute in

    . We have a team of experienced Java professionals who help our students learn Java with the help of Live Base Projects. The object-

    oriented, java training in noida , class-based build

    of Java has made it one of most popular programming languages and the demand of professionals with certification in Advance Java training is at an

    all-time high not just in India but foreign countries too.

    By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13

    years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best

    Java training in Noida.

    java training institute in noida
    java training in noida
    best java training institute in noida
    java coaching in noida
    java institute in noida

  41. The use and interface of Audio to text message is extremely easy to use and simple, making it usable for every single versatile client. It makes forming messages voice generator

  42. nice and interesting article about "A Java Debugging plugin for Sublime Text" thanks for sharing.
    Data Science Training in Chennai

  43. nice article very interesting thanks for sharing.

    Selenium Training in Chennai

  44. This comment has been removed by the author.

  45. thanks for sharing..hope you will share more article like this
    Python Training in Chennai

  46. Nice and usefull contents. thanks for sharing. expecting much in the future.

    RPA Training in Chennai

  47. This was an nice and amazing and the given contents were very useful and the precision has given here is good.hadoop training in chennai


  48. This was an nice and amazing and the given contents were very useful and the precision has given here is good.
    Bigdata Analytics Training in Chennai

  49. Appreciating the persistence you put into your blog and detailed information you provide

    selenium training in chennai
    aws training in chennai

  50. I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favourites blog site list and will be checking back soon.

    java training in chennai | java training in bangalore

    java online training | java training in pune


  51. I've been surfing on the web more than 3 hours today, yet I never found any stupefying article like yours. It's imperatively worth for me. As I would see it, if all web proprietors and bloggers made confusing substance as you did, the net will be in a general sense more profitable than at whatever point in late memory.

    Digital Marketing Training in Mumbai

    Six Sigma Training in Dubai

    Six Sigma Abu Dhabi

  52. This comment has been removed by the author.

  53. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    rpa training in Chennai | rpa training in pune

    rpa training in tambaram | rpa training in sholinganallur

    rpa training in Chennai | rpa training in velachery

    rpa online training | rpa training in bangalore

  54. I think this is a great site to post and I have read most of contents and I found it useful for my Career .Thanks for the useful information. For any information or Queries Comment like and share it.

    PMP Training Abu Dhabi

    GDPR Training in Hyderabad

    Digital Marketing Training in Hyderabad

    six sigma Training Pune

  55. Very nice post here and 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.

    angularjs Training in bangalore

    angularjs Training in btm

    angularjs Training in electronic-city

    angularjs Training in online

    angularjs Training in marathahalli

  56. I have read your blog and I gathered some needful information from your blog. Keep update your blog. Waiting for your next update. Java Training in Chennai | Python Training in Chennai