What code highlighting libs are there for Java?

Fabian Buch picture Fabian Buch · Oct 21, 2008 · Viewed 13k times · Source

I'd like them to be easy to bundle, with few dependencies and easy to use.

Answer

Miguel Ping picture Miguel Ping · Oct 21, 2008

Do you want to highlight Java code or use a Java lib to highlight some other code?

I use these two: https://jhighlight.dev.java.net/ (server-side) for xml and http://code.google.com/p/syntaxhighlighter/ (js lib) for other stuff. The latter has something called 'brushes' which are "pluggable" .js for several langauges. If you are doing simple highlighting, I recommend the ,js approach.