Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a Java mode in CodeMirror editor?

I have read CodeMirror User Manual, but I couldn't find how to set mode for JAVA, could you help me?

CodeMirror.fromTextArea(document.getElementById("code1"), {
  lineNumbers: true,
  mode: "text/x-csrc",
  matchBrackets: true
});
like image 601
Narasimham431 Avatar asked Dec 20 '25 00:12

Narasimham431


1 Answers

"text/x-java" is the MIME type used to get the Java mode.

like image 114
GG. Avatar answered Dec 21 '25 12:12

GG.