Skip to content

meltuhamy/webjdb

Repository files navigation

webjdb

Java debugging in your browser.
Uses the Java Debugger Interface and websockets so that you can debug a java program from within a web browser.

Potential Advantages

  • Customizable - for those who want to write javascript to customize a debugger's UI eg. change themes, layout, keyboard shortcuts, custom plugins
  • Highly visual - browsers can give strong visual feedback - CSS3 transisitons, d3.js data visualization. Much easier to write these graphical features for web browsers than on native.
  • Portable - works on all OS's, on any modern browser
  • Lightweight - minimalist UI, quick to open/close.
  • Keyboard oriented - access all aspects of debugger without touching the mouse
  • It's not jdb - jdb sucks for actual debugging

Potential Users: vim/emacs users, those who perhaps don't want to use a java IDE, those interested in web technologies. Ideal for small java projects - e.g. practicing for interviews, competitive programming, quickly testing a java language feature.


Currently a proof of concept. Very early in development.
Right now webjdb can only inspect the stack frame of a program and send the value of a variable to be displayed in the browser.

Dependencies

  • Spring 4
  • Gradle
  • Websockets (sock.js)
  • JDK >= 1.8.0_05 (needs JDI which belongs to JDK's tools.jar)

Getting started

You need to download the Java Development Kit 8. You may also need to set your JAVA_HOME environment variable. This can be done by adding the following to your .bashrc/.zshrc:

export JAVA_HOME=$(/usr/libexec/java_home)
  1. clone the repo then cd to the root of the project.
  2. Install gradle brew install gradle.
  3. Compile the target javac -g Target.java (-g flag needed, it adds debug info)
  4. In one terminal session, run the target application, telling it to listen on port 5050: sh runtarget.sh
  5. In another terminal session, build and run the webserver+debugger: ./gradlew bootRun
  6. Open your browser at localhost:8080
  7. Click the connect button. This tells the debugger to connect to the target that's listening on port 5050.

At this point, you can click the step and print frame buttons to step through the program and print the contents of the current stack frame.

References

Uses code from:

About

Java debugging in your browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published