Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugger for emacs to step through java source code

GNU Emacs 25.1.1
Fedora release 24 (Twenty Four)
Gradle 2.14.1

I have been doing a lot of java applications lately and want to know what is the best debugger for stepping through java applications.

I would like to debug my apps from inside emacs environment by setting breakpoints and inspecting variables, etc.

I am using gradle as my build tool for compiling the application.

I have no idea how to set this up, if someone could explain how to do this.

Many thanks for any suggestions.

like image 210
ant2009 Avatar asked Sep 12 '16 04:09

ant2009


2 Answers

You could use jdb (it comes with GUD and you should have nothing to install).

Just enter M-x jdb ENT

and enter the command you would like to launch jdb with (For example jdb HelloWorld) and run/debug like in a regular jdb session.

like image 72
vmonteco Avatar answered Sep 28 '22 15:09

vmonteco


I'm using JDEE (Java Development Environment for Emacs) to develop Java in Emacs, you might want to try with it. It is an add on sotware package for Emacs that assists in the development of software in the Java Programming Language, and provides many Emacs commands that help with programming of Java, including debugging.

The JDE provides two options for debugging Java applications.

  • An Emacs interface to jdb, the command-line debugger that comes with the JDK. See Debugging with jdb for more information.

  • JDEbug, a Java debugger developed specifically for use with the JDE. See JDEbug User's Guide for more information.

JDEbug provides more debugging features.

Screenshots of JDEbug

enter image description here

enter image description here

like image 45
songyuanyao Avatar answered Sep 28 '22 16:09

songyuanyao