zoukankan      html  css  js  c++  java
  • 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]:

  • 相关阅读:
    Problem: 数字的拆分之二
    Problem: 数字的拆分之一
    Problem : [Usaco2014 Dec]Piggy Back
    Problem: 八中厕所的门
    Problem : [Usaco2007 Open]Catch That Cow 抓住那只牛
    vim设置
    生活致富靠传销?北海警方:排版错误已整改
    SpringBoot(二)——配置文件
    SpringBoot(一)——IDEA创建项目
    Redis(一)——安装与使用
  • 原文地址:https://www.cnblogs.com/sfccl/p/13957080.html
Copyright © 2011-2022 走看看