Using Java's Jupyter Kernel with Google Colaboratory

Continuation of the last time (Run Java program with Google Colaboratory)

Difference from last time

Run Java on Colab just like using python with Java's Jupyter Kernel

procedure

1. Download .ipynb from colab

As it is image.png

2. Rewrite .ipynb

The original content is as follows

ColabJava.ipynb


{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "ColabJava.ipynb",
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "id": "hXaCsZGNbimN",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": 0,
      "outputs": []
    }
  ]
}

Rewrite kernelspec

After change.ipynb


    ...
    "kernelspec": {
      "name": "java",
      "display_name": "Java"
    }
    ...

Insert Jupyter Kernel

Upload modified .ipynb from Upload Notebook Since IJava is used this time, execute the following cell with the opened colab.

!git clone https://github.com/SpencerPark/IJava.git
%cd IJava/
!./gradlew installKernel

At first, there is no Java Kernel, so the following message is displayed at the bottom left. image.png So, when the above cell is completed, save the notebook settings again according to Java.

Total victory!

image.png

Bonus (using an external library)

Although it is written properly in the IJava Read me used this time, the external library can also be read and used normally. (Wow!)

image.png

Recommended Posts

Using Java's Jupyter Kernel with Google Colaboratory
Using Graphviz with Jupyter Notebook
Study Python with Google Colaboratory
How to analyze with Google Colaboratory using Kaggle API
Try OpenCV with Google Colaboratory
Try to implement linear regression using Pytorch with Google Colaboratory
OpenCV feature detection with Google Colaboratory
Google colaboratory
[Beginner] Python web scraping using Google Colaboratory
Usual processing notes when using Google Colaboratory
Try using Python with Google Cloud Functions
How to search Google Drive with Google Colaboratory
First-principles calculations for free using Google Colaboratory
Use TPU and Keras with Google Colaboratory
Try using conda virtual environment with Jupyter Notebook
Download files directly to Google Drive (using Google Colaboratory)
Add / remove kernel to use jupyter with venv
I tried simple image processing with Google Colaboratory.
Cheat sheet when scraping with Google Colaboratory (Colab)
How to load files in Google Drive with Google Colaboratory
Easy way to scrape with python using Google Colab
End-to-End single channel sound source separation with Google Colaboratory
Easy learning of 100 language processing knock 2020 with "Google Colaboratory"
Let's easily make a math gif using Google Colaboratory
Building an environment to use CaboCha with google colaboratory
Authenticate Google with Django
Multiple selections with Jupyter
Candlestick with plotly + Jupyter
Is it Google Colaboratory?
Kernel Method with Python
I tried using Jupyter
Use nim with Jupyter
Code snippets often used when processing videos with Google Colaboratory
Code snippets often used when using BigQuery with Google Colab
Day 65 (Solution) Jupyter notebook does not work with Kernel Not Conected.
Use "% tensorflow_version 2.x" when using TPU with Tensorflow 2.1.0 in Colaboratory
Using jupyter notobook with VS Code (mac OS) (personal memo)
The usual way to add a Kernel with Jupyter Notebook
Connect the Jupyter Notebook kernel to Spyder with Jupytext enabled
Play with YouTube Data API v3 using Google API Python Client