MCPcopy Index your code
hub / github.com/SpencerPark/IJava

github.com/SpencerPark/IJava @v1.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.0 ↗ · + Follow
167 symbols 353 edges 21 files 4 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

IJava

badge badge

display-img

A Jupyter kernel for executing Java code. The kernel executes code via the new JShell tool. Some of the additional commands should be supported in the future via a syntax similar to the ipython magics.

The kernel is fully functional. Check out the list of features further down in the README. Any requests for new ones or prioritizing current requests are welcomed in the issues along with bug requests, installation help, or other questions.

If you are interested in building your own kernel that runs on the JVM check out the related project that this kernel is build on, jupyter-jvm-basekernel.

For Maven dependency resolution, the kernel is using ShrinkWrap resolvers.

Contents

Try Online

Clicking on the badge badge badges at the top (or right here) will spawn a jupyter server running this kernel. The binder base is the ijava-binder project.

Features

Currently the kernel supports

  • Code execution. output
  • Autocompletion (TAB in Jupyter notebook). autocompletion
  • Code inspection (Shift-TAB up to 4 times in Jupyter notebook). code-inspection
  • Colored, friendly, error message displays. compilation-error incomplete-src-error runtime-error
  • Add maven dependencies at runtime (See also magics.md and Try the example Binder). maven-pom-dep
  • Display rich output (See also display.md and maven magic). Chart library in the demo photo is XChart with the sample code taken from their README. (Try the example Binder) display-img
  • eval function. Note: the signature is Object eval(String) throws Exception. This evaluates the expression (a cell) in the user scope and returns the actual evaluation result instead of a serialized one. eval
  • Configurable evaluation timeout timeout

Requirements

  1. Java JDK >= 9. Not the JRE. Java 11 is the current release and should be considered if selecting a version but if a java 9 or 10 build is installed, everything should still be working fine.

    1. Ensure that the java command is in the PATH and is using version 9. For example: bash > java -version java version "9" Java(TM) SE Runtime Environment (build 9+181) Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

    2. Next ensure that java is in a location where the jdk was installed and not just the jre. Us

Core symbols most depended-on inside this repo

toString
called by 17
src/main/java/io/github/spencerpark/ijava/execution/IJavaExecutionControl.java
appendChildInNewDoc
called by 9
src/main/java/io/github/spencerpark/ijava/magics/MavenResolver.java
build
called by 8
src/main/java/io/github/spencerpark/ijava/execution/CodeEvaluatorBuilder.java
getMessage
called by 8
src/main/java/io/github/spencerpark/ijava/execution/EvaluationTimeoutException.java
getKernelInstance
called by 7
src/main/java/io/github/spencerpark/ijava/runtime/Kernel.java
getShell
called by 6
src/main/java/io/github/spencerpark/ijava/execution/CodeEvaluator.java
maven
called by 5
src/main/java/io/github/spencerpark/ijava/magics/dependencies/CommonRepositories.java
getInstance
called by 5
src/main/java/io/github/spencerpark/ijava/magics/dependencies/Maven.java

Shape

Method 146
Class 21

Languages

Java100%

Modules by API surface

src/main/java/io/github/spencerpark/ijava/JavaKernel.java25 symbols
src/main/java/io/github/spencerpark/ijava/execution/CodeEvaluatorBuilder.java18 symbols
src/main/java/io/github/spencerpark/ijava/magics/MavenResolver.java17 symbols
src/main/java/io/github/spencerpark/ijava/magics/dependencies/Maven.java15 symbols
src/main/java/io/github/spencerpark/ijava/execution/LazyInputStreamDelegate.java12 symbols
src/main/java/io/github/spencerpark/ijava/execution/CodeEvaluator.java11 symbols
src/main/java/io/github/spencerpark/ijava/execution/IJavaExecutionControl.java10 symbols
src/main/java/io/github/spencerpark/ijava/execution/MagicsSourceTransformer.java7 symbols
src/main/java/io/github/spencerpark/ijava/execution/EvaluationTimeoutException.java6 symbols
src/main/java/io/github/spencerpark/ijava/magics/dependencies/CommonRepositories.java5 symbols
src/main/java/io/github/spencerpark/ijava/execution/LazyOutputStreamDelegate.java5 symbols
src/main/java/io/github/spencerpark/ijava/runtime/Display.java4 symbols

For agents

$ claude mcp add IJava \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact