Skip to content

Replace java2html with JHighlight#382

Draft
NirBY wants to merge 1 commit into
Top-Q:masterfrom
NirBY:codex/replace-java2html
Draft

Replace java2html with JHighlight#382
NirBY wants to merge 1 commit into
Top-Q:masterfrom
NirBY:codex/replace-java2html

Conversation

@NirBY
Copy link
Copy Markdown

@NirBY NirBY commented May 8, 2026

Summary

This PR replaces the legacy java2html.jar source-code HTML rendering path with the maintained Maven dependency org.codelibs:jhighlight:1.1.1.

What changed:

  • Added org.codelibs:jhighlight:1.1.1 to parent dependency management.
  • Added JHighlight as a jsystemCore dependency so HtmlCodeWriter can render source directly.
  • Added JHighlight as a runner dependency and included it in the runner assembly under thirdparty/commonLib/jhighlight.jar.
  • Updated install4j packaging to include thirdparty/commonLib/jhighlight.jar instead of thirdparty/lib/java2html.jar.
  • Replaced the reflective de.java2html.* parser/converter calls in HtmlCodeWriter with JavaXhtmlRenderer.
  • Updated user-facing/log messages that previously referenced java2html.jar.
  • Added HtmlCodeWriterTest to verify Java source is rendered through JHighlight.

Compatibility notes

  • JHighlight 1.1.1 was selected intentionally because it is Java 8 bytecode compatible (major version: 52) and therefore remains compatible with both current master and the Java 11 migration path.
  • JHighlight 2.0.0 was checked but not used because it targets Java 17, which would skip over the requested Java 11 compatibility step.
  • No local/internal Maven POM configuration changes are included.

Verification

Passed:

  • mvn -f jsystem-core-projects\pom.xml -pl jsystemCore -am -DskipTests package using JDK 8
  • mvn -f jsystem-core-projects\pom.xml -pl jsystemCore "-Dtest=jsystem.extensions.report.html.HtmlCodeWriterTest" test using JDK 8
  • mvn -f jsystem-core-projects\pom.xml -pl jsystemCore "-Dincludes=org.codelibs:jhighlight" dependency:tree confirmed org.codelibs:jhighlight:jar:1.1.1:compile
  • git diff --cached --check
  • Staged diff scan for common secret/personal-data markers found no matches
  • git grep -n -i "java2html\|de\.java2html" -- . ':!*.jar' ':!*.class' found no remaining source references

Known current-master/environment test noise:

  • The full mvn -f jsystem-core-projects\pom.xml -pl jsystemCore -am test run compiled successfully and the new HtmlCodeWriterTest passed, but the broader legacy suite failed on existing environment-dependent tests: missing generated META-INF/jsystemCore.build.properties, missing report8.html, and no local POP3 server for PublishTest.

Upgrade plan

  1. Merge the Java 11 compatibility PR first if Java 11 validation is required on master.
  2. Rebase this branch on the Java 11-ready base.
  3. Re-run the same focused JHighlight test plus the full module test suite under JDK 11.
  4. Keep JHighlight at 1.1.1 until the project intentionally moves beyond Java 11, because newer JHighlight currently requires Java 17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants