Jupyter notebooks (on Windows)

In the previous post, I quickly described how to set up Jupyter Notebooks to run Java code. Now I want to explain how to set things up on Windows using Anaconda. Of course, you have to have a Java 9 JDK or later installed on your system, as the JDK's JShell feature is required to execute the Java code on the fly.

  • open a command prompt

  • create a new environment using anaconda (e.g., for Python 3.5)

    conda create -n py35-ijava python=3.5
    
  • activate environment

    activate py35-ijava
    
  • install Jupyter

    pip install jupyter
    
  • download the latest IJava release (at time of writing, this was 1.20)

  • unzip the IJava release (e.g., with your File browser or 7-Zip)

  • change into the directory where you extracted the release, containing the install.py, e.g.:

    cd C:\Users\fracpete\Downloads\ijava-1.2.0
    
  • install the kernel

    python install.py --sys-prefix
    
  • start Jupyter

    jupyter-notebook
    
  • now you can create new (Java) notebooks!