xp1632 / VPE_IP

0 stars 0 forks source link

Install IJAVA Java kernel in jupyterlab #17

Open xp1632 opened 11 months ago

xp1632 commented 11 months ago
Version requirements-> Java Jupyterlab Jupyter Notebook
Components V
IJAVA Java Kernel 9+ until 2019 until 2019
Fiji 8(?)
xp1632 commented 11 months ago
xp1632 commented 11 months ago

3.7.1 Install Ijava: ref of the book: ( https://subscription.packtpub.com/book/data/9781789137408/5)

3.7.2 Error of Gradlew and JAVA version

E:\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
xp1632 commented 11 months ago

3.7.3 IJAVA branch that has JAVA 17 compatible gradle setup


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

3.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
xp1632 commented 11 months ago

3.7.6 No kernel found


3.7.7 we try the pre-built libnary installation:

ref:(https://github.com/SpencerPark/IJava#install-pre-built-binary)

(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

xp1632 commented 11 months ago

image

image

xp1632 commented 11 months ago