Skip to content

Instantly share code, notes, and snippets.

@gansai
Created January 19, 2019 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gansai/2245ff6881e0b0aeb511b16e745085aa to your computer and use it in GitHub Desktop.
Save gansai/2245ff6881e0b0aeb511b16e745085aa to your computer and use it in GitHub Desktop.
Please follow below steps to use Java on Jupyter Notebook, to experiment Java code on browser and share snippets with others for trying out.
Please note that this is for windows environment.
1. Install Anaconda for Windows from https://www.anaconda.com/download/
2. After installation of Anaconda, open Anaconda Navigator and install Jupyter Notebook
3. Download java kernel from https://github.com/SpencerPark/IJava/releases/download/v1.2.0/ijava-1.2.0.zip
4. Extract ijava-1.2.0.zip file
5. Open Anaconda command prompt
6. Navigate to ijava-1.2.0 folder and type: python install.py
7. This will add java kernel to list of Jupyter kernels.
8. Confirm, by typing: jupyter kernelspec list
9. Download JAVA11 .msi to your local system from: https://www.azul.com/downloads/zulu/zulu-windows/
10. Install Java 11 to your system and edit PATH environment variable to point to: C:\Program Files\Zulu\zulu-11\bin
11. The reason Java11 is suggested is: IJava kernel is written for Java9 onwards.
12. Open Anaconda command prompt . You can check Java kernel in Jupyter console with below command:
13. jupyter console --kernel=java
14. Apart from Jupyter console, you can check Java kernel in browser, by switching Kernel from default python to java
15. Check Java examples from https://mybinder.org/v2/gh/SpencerPark/ijava-binder/master?urlpath=lab
16. You can also dynamically import Maven dependencies, see examples from above binder notebooks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment