-
Notifications
You must be signed in to change notification settings - Fork 134
Quick Start: Jupyter Notebook for Java
Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. It is very popular for learning program languages, data analysis and machine learning, etc. Jupyter Notebook can be used with many programming languages, including Python, R, Julia, and Java too! If you're interested in trying it out with Java, please follow the installation steps below. We look forward to hearing your feedback!
Step 1. Install VS Code Insiders.
Step 2. Install pre-built binary of Java language kernel for Jupyter notebook, called IJava
Prerequisites :
- JDK version 9 or above is required; You can check your JDK version by running "java --version" in command window.
- Python 3 is required to install the Java language kernel. Can be installed from here.
- Run " pip install jupyter-client"
- Download the release from the release tab. A prepackaged distribution will be in an artifact named ijava-$version.zip.
- Unzip it into a temporary location. It should have at least the install.py and java folder extracted in there.
- Open terminal and enter into the root directory of the temporary location.
- Run " python install.py --user" to install the Java language kernel.
Note: for more details on IJava, you can refer here
Step 3. Install the Jupyter Extension
Step 4. Open or create a notebook file
-
To create a new notebook open the command palette ( Windows: Ctrl + Shift + P; macOS: Command + Shift + P ) and select the command " Jupyter: Create New Blank Jupyter Notebook"
-
Select Java as kernel by clicking on the kernel picker in the bottom right of the status bar OR by invoking the " Notebook: Select Notebook Kernel" command.
- Change the cell language to Java by clicking the language picker OR by invoking the " Notebook: Change Cell Language" command.
- Type 'System.out.println("Hello, Java");' and click run. You should see "Hello, Java" is printed out below your code.
Step 5. Happy coding with Jupyter!
We look forward to your feedback.
Open the Command Palette ( Command+Shift+P on macOS and Ctrl+Shift+P on Windows/Linux ) and type in one of the following commands:
Command | Description |
---|---|
Jupyter: Create New Blank Jupyter Notebook | Create a new blank Jupyter Notebook |
Notebook: Select Notebook Kernel | Select or switch kernels within your notebook |
Notebook: Change Cell Language | Change the language of the cell currently in focus |
Jupyter: Export to HTML Jupyter: Export to PDF | Create a presentation-friendly version of your notebook in HTML or PDF |