• jupyter notebook 添加java核心


    参考:https://github.com/SpencerPark/IJava

    一、环境(java核心需要jdk9以上支持,可在https://www.oracle.com/java/technologies/javase-jdk15-downloads.html下载)

    已安装java,版本如下:

    [root@localhost ~]# java -version
    java version "15.0.1" 2020-10-20
    Java(TM) SE Runtime Environment (build 15.0.1+9-18)
    Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)

    二、java核心下载:

    (python) [root@localhost ~]# wget https://github.com/SpencerPark/IJava/releases/download/v1.2.0/ijava-1.2.0.zip

    三、安装过程

    1、解压:

    (python) [root@localhost ~]# unzip ijava-1.2.0.zip

    生成java目录和install.py安装文件

    2、执行安装:

    (python) [root@localhost ~]# python install.py --sys-prefix

    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 "/root/miniconda3/envs/python/share/jupyter/kernels/java"

    3、查看安装核心情况

    (python) [root@localhost ~]# jupyter kernelspec list
    Available kernels:
      java       /root/miniconda3/envs/python/share/jupyter/kernels/java
      python3    /root/miniconda3/envs/python/share/jupyter/kernels/python3

    4、移除核心

    (python) [root@localhost ~]# jupyter kernelspec remove java

    5、模拟运行核心

    (python) [root@localhost ~]# jupyter console --kernel=python3         #模拟运行python3核心
    Jupyter console 6.2.0

    Python 3.8.5 | packaged by conda-forge | (default, Sep 16 2020, 18:01:20)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.

    In [1]:

    (python) [root@localhost ~]# jupyter console --kernel=java                  #模拟运行java核心
    Jupyter console 6.2.0

    Python 3.8.5 | packaged by conda-forge | (default, Sep 16 2020, 18:01:20)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.

    In [1]:

  • 相关阅读:
    元数据的优势
    老婆从今天开始出差
    清单元数据表中的导出类型定义
    Singleton模式
    拖管代码的优势
    元数据
    "软件随想录"阅读笔记
    《敏捷软件开发》学习笔记:敏捷设计原则
    项目管理中的三个"凡是"
    Python基础(1):数据类型
  • 原文地址:https://www.cnblogs.com/sfccl/p/13957080.html
Copyright © 2020-2023  润新知