Welcome to Jupyter Java, a GitHub organization created to simplify the discovery of various ways to use Java with Jupyter notebooks. We’re not here to start a Java vs Python debate, we’re all about the love of coding, regardless of the language! So, let’s keep it light-hearted and fun.
We provide JBang scripts to set up and install various Jupyter kernels, along with Docker images for easy execution in various Jupyter environments. Enjoy exploring!
The simplest way to run Java based Jupyter kernels is to install JBang and run the following:
jbang install-kernel@jupyter-java
It will install a default Java kernel (currently IJava) which is then available locally on your computer. This can then be used in your local Jupyter install or via editors that support jupyter notebook such as vscode, intellij etc.
The great thing about this JBang driven approach is that it makes it accessible to install in many online Jupyter notebooks too.
!pip install jbang
import jbang
jbang.exec("trust add https://github.com/jupyter-java")
jbang.exec("install-kernel@jupyter-java")
Once this has executed successfully you should be able to change the kernel/runtime in your Jupyter notebook.
Note
|
JBang will automatically use local Java or download a JDK if needed. This makes these steps all you need to do to get started with Java based kernels in any common Jupyter notebooks or IDE. |
We’ve successfully tested this on the following online Jupyter notebooks:
-
Red Hat OpenShift Sandbox with Red Hat DataScience
…and on the following Visual Studio based IDE’s (requires install of Jupyter extension):
The following Java related Kernels are available:
You install them by passing their name as first argument. i.e. to install Kotlin do: install-kernel@jupyter-java kotlin
We’ve started an awesome list of Jupyter Java content, please feel free to contribute!