Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java kernel for Jupyter

Tags:

java

jupyter

Is there a java kernel for "Jupyter"? I'm using Mac OS El Capitan.

I tried https://github.com/Bachmann1234/java9_kernel but to no avail.

like image 882
leo Avatar asked Nov 28 '15 15:11

leo


People also ask

Can I run Java in Jupyter Notebook?

A Jupyter kernel for executing Java code. The kernel executes code via the new JShell tool. Some of the additional commands should be supported as needed via a syntax similar to the ipython magics.

What kernels are available for Jupyter?

5.1 Language support: kernels The Jupyter system supports over 100 programming languages (called “kernels” in the Jupyter ecosystem) including Python, Java, R, Julia, Matlab, Octave, Scheme, Processing, Scala, and many more.


3 Answers

There are a number of options, many listed on the official Jupyter kernel list:

  1. The scijava-jupyter-kernel supports Java for Jupyter

    scijava-jupyter-kernel aims to be a polyglot Jupyter kernel. It uses the Scijava scripting languages to execute the code in Jupyter client and it's possible to use different languages in the same notebook. Some of the supported languages are Groovy (default), Python, Beanshell, Clojure, Java, Javascript, Ruby and Scala. The kernel has been originally created to work with ImageJ. See here for more details. Under the hood scijava-jupyter-kernel uses the Beaker base kernel.

  2. BeakerX extensions for Jupyter come with Java cell support.

    BeakerX contains and depends on many projects including: The kernel is originally derived from lappsgrid, but has been rewritten in Java and refactored and expanded. The Java support uses Adrian Witas' org.abstractmeta.toolbox.

Updated:

  1. IJava, a Jupyter kernel for executing Java code.

    The kernel executes code via the new JShell tool. Some of the additional commands should be supported in the future via a syntax similar to the ipython magics. The kernel is fully functional. [...] If you are interested in building your own kernel that runs on the JVM check out the related project that this kernel is build on, jupyter-jvm-basekernel.

You may also be interested in:

  1. Kotlin kernel for IPython/Jupyter, a basic kotlin REPL kernel.
like image 197
JeremyDouglass Avatar answered Oct 17 '22 05:10

JeremyDouglass


I know this is a shameless plug, but I think it's important to actually state that at this point there is no Java kernel for Jupyter. You can see the list of available kernels here in case you think that might have changed when you are reading this.

===== update =====

There is now a new solution that may be relevant here called IJava.

like image 40
Aleksandar Savkov Avatar answered Oct 17 '22 04:10

Aleksandar Savkov


Try IJava kernel for Jupyter. This Kernel works only with Java 9 or above. I have using this for some time now with Java 10 on windows. It is working fine, have not noticed any issues so far.

However if you have scijava-jupyter-kernel , IJava karnel will fail to start. As scijava-jupyter-kernel is dependent on OpenJdk 8. And IJava is compiled with JDK9.

like image 30
Debashish Avatar answered Oct 17 '22 04:10

Debashish