Primitive JSwat 2.40 integration for emacs-eclim.
emacs-eclim
doesn’t provide any debugger support.
- Only JSwat 2.40 is supported. Newer versions of JSwat seem to use NetBeans RCP platform and there doesn’t seem to be a way to pass commands to JSwat from a shell invocation.
- Breakpoints can only be set within JSwat.
- The only thing that this plugin does is the following:
- Setup the classpath for JSwat.
- Setup the source path for JSwat (From the Eclipse
.classpath
project file). - Setup the main class to run.
- Setup the file to edit upon when JSwat is launched.
Add the following to your el-get-sources
.
(:name eclim-jswat :type github :pkgname "yveszoundi/eclim-jswat")
Add the following to your Cask
file.
(depends-on "eclim-jswat" :git "https://github.com/yveszoundi/eclim-jswat")
Download eclim-jswat.el
and add it to a folder within your Emacs load-path
.
See for reference the relevant Emacs Manual page for details.
You must set the main class of the eclim
managed project.
The preference variable is org.eclim.java.run.mainclass
.
I use the following function to achieve it:
(defun ers-eclim-project-set-as-main-class () (interactive) (if (not (string= major-mode "java-mode")) (message "Sorry cannot run current buffer.")) (compile (concat eclim-executable " -command project_setting" " -p " eclim--project-name " -s " "org.eclim.java.run.mainclass" " -v " (eclim-package-and-class))))
Add the following to your Emacs init
file and replace the value of
eclim-jswat-path
with the location of your JSwat 2.0 installation.
(eval-after-load "eclim-jswat" (progn (require 'eclim-jswat) '(setq eclim-jswat-path (expand-file-name "~/Downloads/jswat-2.40"))))
You should now be able to run jswat via M-x eclim-jswat-run
.
You can bind it to a keystroke of your liking for convenience.