Continuation of the last time (Run Java program with Google Colaboratory)
Run Java on Colab just like using python with Java's Jupyter Kernel
.ipynb
from colabAs it is
.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"
}
...
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. So, when the above cell is completed, save the notebook settings again according to Java.
Total victory!
Although it is written properly in the IJava Read me used this time, the external library can also be read and used normally. (Wow!)
Recommended Posts