As you know there is a Syntax highlighter for PHP called GeSHi which supports a great number of Programming Languages or Code formats.
However, I couldn\'t find such
Have a look at JHighlighter or jEdit Syntax Package. All mentioned languages aren't supported out of the box. However, you have the sources, so I guess it should be possible to add language support.
Not a direct answer but, if client-side syntax highlighting is an option, the SyntaxHighlighter library from Alex Gorbatchev is an awesome javascript library, supports lots of languages and is highly extensible.
Two related questions:
What code highlighting libs are there for Java? Where can I find a syntax highlighting library for Java?
And one library I found: http://colorer.sourceforge.net/
You could use Pygments through Jython. Won't be as fast as a Java solution, but much faster than interacting with a remote server.
Barring that, you could run Geshi locally and pipe source code through it, that would also beat an HTTP round trip.
There is a port of prettify.js for Java: java-prettify.
It can be used to produce HTML (computed in Java), as I discussed here: Use the java-prettify parser to create HTML
It seems that it is possible to run GeSHi from Java: GeSHi4J it seems to be a wrapper that run the PHP library on the JVM.
jedit is a text editor with syntax highlighting support for some 170+ languages via "modes". It also allows you to specify your own syntaxes. You can use the StandaloneTextArea component in your own application as follows:
Use ant to copy all the textarea files to ..\textarea eg:
D:\Source\jedit\jEdit> ant prepare-textArea
However, it misses the file BufferUndoListener.java. Copy this manually by executing
D:\Source\jedit\jEdit> copy org\gjt\sp\jedit\buffer\BufferUndoListener.java ..\textarea\src\org\gjt\sp\jedit\buffer\
In Eclipse create a Java Project from existing source in the directory D:\Source\jedit\textarea
mode.setProperty("file","modes/xml.xml");
to
mode.setProperty("file","src/modes/xml.xml");