I have installed the sysml-v2 kernel from here: SysML-v2-Release/install/jupyter/README.adoc at f49ea19a807a2aa45ad1afed0ed62afe41aabdf9 · Systems-Modeling/SysML-v2-Release · GitHub
The installer automatically installed a recent JVM.
When I run echo %JAVA_HOME%
at the prompt, I get the correct answer C:\Tools\anaconda3\Library\lib\jvm
.
But when I start jupyter lab
from this same prompt, I get the following error:
[I 2025-02-10 08:18:29.600 ServerApp] Kernel started: a1761d55-3b26-42a6-b14b-34235c534b96
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/omg/sysml/jupyter/kernel/ISysML has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:365)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)
It looks like the kernel does not respect the JAVA_HOME
variable and is using the globally installed version 8 JVM instead of the more recent local JVM.
I cannot change this global version 8 JVM installation as I am working in a corporate environment.
What is the correct way to make the kernel use a different JVM?