ibrahim rupawala
ibrahim rupawala

Reputation: 181

How do I configure the kernel while iJAVA to use jupyter notebook for java codes

I am trying to install iJAVA kernel to use Jupyter Notebooks for JAVA codes. I I have completed all the steps till "Installing" from the link https://github.com/SpencerPark/IJava. However I am not able to understand the steps from "Configuring".

  1. Do I need to create variables in the environment variable with the list of names in column "Environment variable" and values in column "Default" from the table "list of options" shown in the step "Configuring".
  2. What do I need to do for steps "Simple glob syntax" and "Changing VM/compiler options" in the step configuring.
  3. Do I need to start the Jupyter Notebooks normally like we do for the Python or else do I need to use any special commands ?. Currently when I am opening Jupyter Notebook I am not observing the option to create a Java notebook

I have already tried creating environment variable with the list of names in column "Environment variable" and values in column "Default" from the table "list of options" shown in the step "Configuring".

I am using:

Please notice that my end goal is to use jupyter notebook with Java Kernel as shown in the image below:

enter image description here

Can anyone help with these steps ?

Upvotes: 2

Views: 4713

Answers (2)

per
per

Reputation: 11

For me the issue came between steps 2 and 3 in the installation instructions. Here is the solution:

After completing step 2, open the command prompt and navigate to the temporary installation folder. For me it was Downloads\ijava-1.3.0.

Run the command jupyter kernelspec install java

Check for successful installation by running the command jupyter kernelspec list

Upvotes: 1

SpencerPark
SpencerPark

Reputation: 3506

The kernel should work out of the box with no configuration required.

First check that the kernel is properly installed with jupyter kernelspec list which should show where the kernel is installed. If java is not in that list, rewind a bit in the installation instructions to see where the problem is.

jupyter kernelspec list
Available kernels:
  java       ...\jupyter\kernels\java
  python3    ...\jupyter\kernels\python3

Install instructions copied for reference:

  1. Download the release from the releases tab. A prepackaged distribution will be in an artifact named ijava-$version.zip.

  2. Unzip it into a temporary location. It should have at least the install.py and java folder extracted in there.

  3. Run the installer with the same python command used to install jupyter. The installer is a python script and has the same options as jupyter kernelspec install but additionally supports configuring some of the kernel properties mentioned further below in the README.

    # Pass the -h option to see the help page
    > python3 install.py -h
    
    # Otherwise a common install command is
    > python3 install.py --sys-prefix
    
  4. Check that it installed with jupyter kernelspec list which should contain java.

Check that the jupyter --paths includes the installation location returned by running the installer in step 3. Particularly if installing to --sys-prefix and there are multiple python installations on the system, you might be installing under the sys.prefix of an installation different from the jupyter command in your PATH.

To address the specific sub questions about configuration:

Do I need to create variables in the environment variable with the list of names in column "Environment variable" and values in column "Default" from the table "list of options" shown in the step "Configuring".

The table outlines what you could change if needed. If an environment variable is undefined, the default value from the table is used.

What do I need to do for steps "Simple glob syntax" and "Changing VM/compiler options" in the step configuring.

Some configuration options specified files or directories. To keep things easy to use these options allow specifying paths with that "Simple glob syntax" which is a subset of an actual glob implementation that was enough to get the job done.

Changing VM and compiler options is again optional.

Do I need to start the Jupyter Notebooks normally like we do for the Python or else do I need to use any special commands ?. Currently when I am opening Jupyter Notebook I am not observing the option to create a Java notebook

Yep, start with jupyter notebook as usual and if installed correctly, a Java option should appear when changing the kernel or creating a new notebook.

Upvotes: 0

Related Questions