Java Kernel Guide

See also: Assignment Creation and Notebook‑Based Assignments.

Create a basic Java assignment

Tip

Download a starter notebook: Download Java.ipynb

  1. Upload the notebook:

    • Click the Upload button in the top‑left of the notebook UI
    • Select the downloaded file and confirm
  2. Open it:

    • The file appears in the left panel — double‑click to open
  3. Run it to verify everything works


Add and use third‑party libraries (IJava)

If your Java kernel supports Maven coordinates (e.g., IJava), you can add dependencies with a magic command and import them immediately.

// Add a Maven dependency
%maven com.google.guava:guava:32.1.2-jre

import com.google.common.collect.ImmutableList;

ImmutableList<String> items = ImmutableList.of("a", "b", "c");
System.out.println(items);

Another example:

%maven org.apache.commons:commons-lang3:3.13.0

import org.apache.commons.lang3.StringUtils;

System.out.println(StringUtils.capitalize("java kernel"));

Note: If %maven is not available in your environment, use preinstalled libraries provided by the kernel image, or contact your administrator about enabling dependency management in the Java kernel.