Skip to content

how to use %classpath magic correctly? #154

Description

@david-romano

For context, I use this code:

%%sh
# Install java kernel
wget -q https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip
unzip -q ijava-1.3.0.zip
python install.py

# Install proxy for the java kernel
wget -qO- https://gist.github.com/SpencerPark/e2732061ad19c1afa4a33a58cb8f18a9/archive/b6cff2bf09b6832344e576ea1e4731f0fb3df10c.tar.gz | tar xvz --strip-components=1
python install_ipc_proxy_kernel.py --kernel=java --implementation=ipc_proxy_kernel.py

(from this gist) to load IJava as the kernel in a Google Colab notebook, but no matter what I do, the classpath is always

/usr/local/share/jupyter/kernels/java_tcp/ijava-1.3.0.jar

Here's a Google Colab gist that shows how I'm using %classpath and how the classpath isn't updated afterwards.

Am I using the magic incorrectly? I was hoping to be able import my own classes to use in a Google Colab notebook, but I can't get IJava to recognize them.

Thanks for any help!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions