IJava icon indicating copy to clipboard operation
IJava copied to clipboard

jupyter notebook webbased: NO java syntax highligting

Open sant527 opened this issue 4 years ago • 3 comments

I have installed this its very very useful

I want to know how to see syntax highlighting of my code.

I ran the command in my terminal

jupyter notebook

Then jupyter notebook opens and then i select Java shell

I see the java code without syntax highlighting. How to get the syntax highlighting

image

sant527 avatar Jul 05 '20 07:07 sant527

close and reopen the notebook, it worked for me

3xau1o avatar Jul 14 '20 18:07 3xau1o

This happens because the notebook metadata is not populated with enough information when it is created.

    "language_info": {
        "name": ""
    }

When you change the above to below, syntax highlighting starts to work.

    "language_info": {
        "name": "java"
    }

This seem to be a pretty common problem in Jupyter. I've searched for it and Julia community has (or had) the same problem and there was a fix like that. See https://github.com/jupyterlab/jupyterlab/issues/6826#issue-467830861

A good fix should make sure that every notebook is created with proper metadata, but meanwhile you can quickly fix manually for each notebook you are using.

In case of Jupyter Lab there you can do this in the left sidebar. Go to the tools icon on the very right, expand the "Advanced Tools", and there you can edit the metadata.

kyagrd avatar Jul 30 '20 02:07 kyagrd

Thank you, When i close and reopen the notebook, it worked for me it woked.

Also i will try @kyagrd solution

sant527 avatar Aug 06 '20 18:08 sant527