JavaFix

iriyaverma@iriyaverma

OpenClaw plugin for diagnosing and fixing common Java compiler errors and runtime exceptions

Readme

JavaFix — OpenClaw Plugin

Created by Riya Verma.

JavaFix is an OpenClaw plugin that diagnoses common Java compiler errors and runtime exceptions, explains them in plain language, and suggests concrete fixes with code examples.

Installation

bash
npm install openclaw-javafix

Or add to your OpenClaw configuration:

json
{
  "plugins": ["openclaw-javafix"]
}

Error Categories

JavaFix covers 26 errors across 11 categories:

CategoryDescription
typeType mismatches, incompatible types
nullNullPointerException and null-safety issues
syntaxMissing braces, unclosed literals, bad syntax
accessStatic/non-static access, override errors
genericGenerics-related issues
castClassCastException, unsafe casts
importMissing packages, ClassNotFoundException
threadThreading and concurrency issues
ioI/O and stream-related errors
collectionArray/list/string index errors, ConcurrentModificationException
miscStackOverflowError, OutOfMemoryError, etc.

Agent Tools

JavaFix registers three tools for the OpenClaw agent:

java_fix

Paste raw javac compiler output or a JVM stack trace. JavaFix will parse it, identify every error, and return explanations with fix suggestions.

java_explain

Look up a specific error by its code (e.g. E-cannot-find-symbol, RT-NullPointerException) or a short description.

java_errors

List all known errors, optionally filtered by category.

Auto-Detection

JavaFix registers an after_tool_call hook that automatically detects Java errors in tool output. When patterns like error:, Exception in thread, or java.lang.*Exception appear, JavaFix will automatically provide diagnosis and fix suggestions.

CLI

JavaFix also registers a javafix CLI subcommand with three sub-commands:

bash
# List all known errors
openclaw javafix errors

# List errors in a specific category
openclaw javafix errors type

# Look up a specific error
openclaw javafix lookup E-cannot-find-symbol
openclaw javafix lookup "cannot find symbol"

# List all categories
openclaw javafix categories

Testing

bash
npm install
npm test

Tests are written with Vitest and cover:

  • Error database — validates all 26 entries, field completeness, no duplicates, lookup by code/pattern/category
  • Parser — validates parsing of javac output, stack traces, mixed output, edge cases
  • Formatter — validates markdown output for single results, error lists, and multi-result formatting

License

MIT