Reputation: 4769
i am pretty new to programming, and having some trouble with debugging java programs. I try to use gdb to debug my java program, but no matter how hard i try, it still does not work at all.
The error message in the minibuffer of emacs(GUI) is always "No such file or directory , gdb". I am sure that my currrent directory is the the same as the sourcefile and the compiled file(executable file compiled with "javac -g xx.java") .
So, my confusion is that: Does the error has something to do with: 1. wrong syntax of invoking gdb (used Meta gdb xx ) 2. what is the executable java file for gdb/ how gdb identify them 3. is it possible that my installation of EMACS is incomplete, as i input the gdb to the command line(Win8 system), NO gdb prompt appears at all(something like(gdb....))
Upvotes: 0
Views: 2380
Reputation: 17945
No such file or directory, gdb
gdb
is not installed. To fix it, install gdb
. Note that gdb
is not part of emacs, it's a separate program. If you get gdb
with a bundle, it would usually be part of gcc
, the GNU Compiler Collection, not Emacs. The source is the same - FSF (Free Software Foundation) / GNU Project (GNU is Not Unix), but it is different / separate packages.gdb
cannot find the executable. See next point for this.However, looking at your description, it's more likely that gdb
is not installed at all.
gdb
cannot debug Java directlygdb
cannot be used to debug Java programs in general, it can only be used to debug Java programs that were compiled into binaries using gcj
. See also Java Debugging with gdb
from its manual.
You may want to go for jdb
instead, which is the Java Debugger that comes with a JDK.
Emacs is a great text editor indeed. The jokes that people make about Emacs, like "Actually Emacs is a Common Lisp implementation for developing computer games which happens to have one of the two best text editors as a demo app" are a pun on its greatness. I'm a vim user myself, and I have only the deepest respect for Emacs and what it contributes to computer science (i.e. Common Lisp).
But no matter how good Emacs and vim are, these days the IDEs beat them to it.
I recommend IntelliJ IDEA and have my reasons for it, but you can't really choose wrong. They're all good!
Several of these things are also offered by Emacs or vim - but not all of them.
I'm a vim power user myself, but I wouldn't use vim for any Java that exceeds Hello, World, because an IDE like IntelliJ IDEA is just so much better. One argument that is often made is that we users invest a lot into editors like vim and emacs learning all their shortcuts for productivity. This knowledge does not need to be lost. IntelliJ IDEA has an IdeaVim plugin for Vim users and an emacsIDEA plugin for Emacs users. I don't know, but I could imagine that the other IDEs have similar plugins.
Upvotes: 2