Open xp1632 opened 11 months ago
Version requirements-> | Java | Jupyterlab | Jupyter Notebook | |
---|---|---|---|---|
Components V | ||||
IJAVA Java Kernel | 9+ | until 2019 | until 2019 | |
Fiji | 8(?) |
3.7.1 Install Ijava: ref of the book: ( https://subscription.packtpub.com/book/data/9781789137408/5)
Install from source (https://github.com/SpencerPark/IJava#install-from-source)
[x] Install JAVA and test through java --version
[x] Find jdk shell throughjava --list-modules | findstr "jdk.jshell"
, shoudl output jdk.jshell@
followed by your java version.
[x] Install Jupyter environment
[x] Clone IJAVA from (https://github.com/SpencerPark/IJava) to local (E:\IJava)
3.7.2 Error of Gradlew and JAVA version
gradlew installKernel
in Windows systemE:\IJava>gradlew installKernel
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
And while check the issue of IJAVA, that is caused by the gradlew in IJAVA is too old for new JAVA version:
One solution is to update gradle as in
3.7.3 IJAVA branch that has JAVA 17 compatible gradle setup
we clone this branch in E:/IJava17/
and in the directory, we run gradlew installKernel --prefix=/path/to/installation/prefix
it download the gradlew of version 7.5.1, original we have 4.8.1 which is too old
Gradle 7.5.1 support JAVA 18, now we are at JAVA 21
we get error :
Welcome to Gradle 7.5.1!
Here are the highlights of this release:
- Support for Java 18
- Support for building with Groovy 4
- Much more responsive continuous builds
- Improved diagnostics for dependency resolution
For more details see https://docs.gradle.org/7.5.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
Could not open cp_settings generic class cache for settings file 'E:\IJava17\settings.gradle' (C:\Users\59803\.gradle\caches\7.5.1\scripts\9bimkwnf2r5z14vz759vkfnnb).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
3.7.4 Trying if java 17 works,
ref: https://blog.csdn.net/wq6ylg08/article/details/91352199
And we also need to change the environment variable of java from version 21 to current 17
which is change JAVA_HOME
: C:\Program Files\Java\jdk-xx
xx is our current 17
and change PATH
: C:\Program Files\Java\jdk-xx\bin
and test java -version
:
now we have
java version "17.0.8" 2023-07-18 LTS
Java(TM) SE Runtime Environment (build 17.0.8+9-LTS-211)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.8+9-LTS-211, mixed mode, sharing)
cmd
to see the change3.7.5 with JAVA 17 and the fixed IJAVA, build successfully
E:\IJava17>gradlew installKernel --prefix=/path/to/installation/prefix
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :installer:compileKotlin
'compileJava' task (current target is 17) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
C:/Users/59803/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1/lib/kotlin-stdlib-1.6.21.jar (version 1.6)
C:/Users/59803/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1/lib/kotlin-stdlib-common-1.6.21.jar (version 1.6)
C:/Users/59803/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1/lib/kotlin-stdlib-jdk7-1.6.21.jar (version 1.6)
C:/Users/59803/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1/lib/kotlin-stdlib-jdk8-1.6.21.jar (version 1.6)
C:/Users/59803/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1/lib/kotlin-reflect-1.6.21.jar (version 1.6)
C:/Users/59803/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.31/ff5d99aecd328872494e8921b72bf6e3af97af3e/kotlin-stdlib-jdk8-1.5.31.jar (version 1.5)
C:/Users/59803/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.31/77e0f2568912e45d26c31fd417a332458508acdf/kotlin-stdlib-jdk7-1.5.31.jar (version 1.5)
C:/Users/59803/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.31/6628d61d0f5603568e72d2d5915d2c034b4f1c55/kotlin-stdlib-1.5.31.jar (version 1.5)
C:/Users/59803/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.31/43331609c7de811fed085e0dfd150874b157c32/kotlin-stdlib-common-1.5.31.jar (version 1.5)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\InstallKernelTask.kt: (45, 24): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\InstallKernelTask.kt: (64, 9): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\InstallKernelTask.kt: (69, 9): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\KernelExtension.kt: (39, 24): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\KernelExtension.kt: (78, 9): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\KernelParameterSpecContainer.kt: (32, 24): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\KernelParameterSpecContainer.kt: (42, 182): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\KernelParameterSpecContainer.kt: (46, 182): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\KernelParameterSpecContainer.kt: (50, 178): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\KernelParameterSpecContainer.kt: (54, 180): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\ZipKernelTask.kt: (43, 24): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\ZipKernelTask.kt: (184, 9): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\ZipKernelTask.kt: (198, 9): 'ConfigureUtil' is deprecated. Deprecated in Java
w: E:\IJava17\installer\src\main\kotlin\io\github\spencerpark\jupyter\gradle\ZipKernelTask.kt: (230, 9): 'ConfigureUtil' is deprecated. Deprecated in Java
> Task :compileJava
Note: E:\IJava17\src\main\java\io\github\spencerpark\ijava\magics\dependencies\Maven.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 58s
12 actionable tasks: 12 executed
3.7.6 No kernel found
jupyter kernelspec list
we still didn't find the kernel3.7.7 we try the pre-built libnary installation:
ref:(https://github.com/SpencerPark/IJava#install-pre-built-binary)
not sure if there's future version conflict
however, by downloading ijava release
unzip it to a temp folder
in temp folder directory,(for me I also activate my conda base env) run python install.py --sys-prefix
,
this time the kernel is installed:
(base) C:\Users\59803\Downloads\ijava-1.3.0>python install.py --sys-prefix
C:\Users\59803\Downloads\ijava-1.3.0\install.py:164: DeprecationWarning: replace is ignored. Installing a kernelspec always replaces an existing installation
install_dest = KernelSpecManager().install_kernel_spec(
Installed java kernel into "E:\Users\59803\anaconda3\share\jupyter\kernels\java"
(base) C:\Users\59803\Downloads\ijava-1.3.0>jupyter kernelspec list Available kernels: python3 C:\Users\59803\AppData\Roaming\Python\share\jupyter\kernels\python3 java E:\Users\59803\anaconda3\share\jupyter\kernels\java