11

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

5 Answers 5

8

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Apparently the syntaxhighligher js library is now located at alexgorbatchev.com/SyntaxHighlighter
If you want server side simple highlighting, there are Java ports of syntaxhighlighter and of prettify. Have a look at my approach groups.google.com/forum/#!topic/java-prettify/AANTzgRe81k
The first link is broken.
There is github.com/codelibs/jhighlight. Don't know for sure that it's the same project as jhighlight.dev.java.net.
2

http://sourceforge.net/projects/jintilla/

http://syntax.jedit.org/

Comments

2

http://tohtml.com/ this one is good.

1 Comment

+1, good to know, but this is for the online syntax highlight.
2

A little update, as we were recently looking for highlighting lib, we found the very good Jygments : http://code.google.com/p/jygments/ .

Available for Ant/Maven/SBT projects throught threecrickets repo, it's a Java port of Pygments ( http://pygments.org ), working for several major languages.

Comments

1

RSyntaxTextArea is worked for meHere

        RSyntaxTextArea textArea = new RSyntaxTextArea();
        textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
        textArea.setCodeFoldingEnabled(true);
        RTextScrollPane rs = new RTextScrollPane(textArea);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.