So I got the Jupyter Kotlin kernel running fairly ...
# datascience
f
So I got the Jupyter Kotlin kernel running fairly quickly but I am now running in some issues that might be related to the kernel internals: I start
IkotlinKt.main
like the python code in jupyter would, but I call it from java code. This allows me to attach a jupyter-console to the kernel and access all the packages. But the classes inside the REPL do not share the static class variables with the java code that started the kotlin kernel via
IkotlinKt.main
. My guess is that this is accidental because this would never be relevant if you the kernel is supposed to be started by Python anyway. Does someone have a quick pointer of the relevant documentation or code concerning those internals?
i
Classpath and classloader used are set in compiler configuration and evaluator configuration in repl.kt file. Classes from kernel project cannot be accessed from repl directly: declare them in jupyter-lib project instead
f
Is there any way to access them from the repl? I am not sure what you mean with
declare them in jupyter-lib project instead
The feature that the REPL has full access to all the classes and static values of the java code that starts
IkotlinKt.main
is essential for what I want to achieve. If this requires some changes in jupyter kotlin kernel I will look into or use some lower level methods to start the kernel
i
There is a
-classpath
argument of main. You may add your classes/jars to it to access symbols in them.
f
I ran into that earlier and am calling it with that argument now, but this is not the issue I am currently talking about
with that I can import a class, but it seems like if I import a specific class inside my java code, set a static variable on it, start the kotlin kernel and attach to it via
jupyter-console
the static variable will not be set