博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Jshell
阅读量:6356 次
发布时间:2019-06-23

本文共 2526 字,大约阅读时间需要 8 分钟。

  hot3.png

一 、安装jdk9

 

方法一

sudo apt install openjdk-9-jdk-headless

 

方法二

下载jdk9:

hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9

cd openjdk9 && sh ./get_source.sh

# 编译

bash ./configure 

#  make

make all
cd build/linux-x86_64-normal-server-release/images/

# 使用jshell

jdk/bin/jshell

二 、试验Jshell

打印一个hello world

试验了一下Calendar类

# dpc @ dpc-thinkpad in /export/service/kulla-dev/openjdk9/build/linux-x86_64-normal-server-release/jdk [22:20:23] $ bin/jshell |  Welcome to JShell -- Version 9-internal|  For an introduction type: /help introjshell> System.out.println("hello world")hello worldjshell> CalCalendar   Callable   jshell> CalCalendar   Callable   jshell> Calendar.getgetAvailableCalendarTypes()   getAvailableLocales()         getInstance(                  jshell> Calendar.getInstance(getInstance(   jshell> Calendar.getInstance()$2 ==> java.util.GregorianCalendar[time=1476195674501,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=19,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2016,MONTH=9,WEEK_OF_YEAR=42,WEEK_OF_MONTH=3,DAY_OF_MONTH=11,DAY_OF_YEAR=285,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=2,AM_PM=1,HOUR=10,HOUR_OF_DAY=22,MINUTE=21,SECOND=14,MILLISECOND=501,ZONE_OFFSET=28800000,DST_OFFSET=0]jshell> Calendar.getInstance().get(Display all 447 possibilities? (y or n)jshell> Calendar.getInstance().get(Cal)Calendar   Callable   jshell> Calendar.getInstance().get(Calendar.D)DATE                   DAY_OF_MONTH           DAY_OF_WEEK            DAY_OF_WEEK_IN_MONTH   DAY_OF_YEAR            DECEMBER               DST_OFFSET             jshell> Calendar.getInstance().get(Calendar.DA)DATE                   DAY_OF_MONTH           DAY_OF_WEEK            DAY_OF_WEEK_IN_MONTH   DAY_OF_YEAR            jshell> Calendar.getInstance().get(Calendar.DAY_OF_)DAY_OF_MONTH           DAY_OF_WEEK            DAY_OF_WEEK_IN_MONTH   DAY_OF_YEAR            jshell> Calendar.getInstance().get(Calendar.DAY_OF_WEEK)DAY_OF_WEEK            DAY_OF_WEEK_IN_MONTH   jshell> Calendar.getInstance().get(Calendar.DAY_OF_WEEK))$3 ==> 3jshell> Calendar.getInstance().get(Calendar.DAY_OF_MONTH)$4 ==> 11jshell> Calendar.getInstance().get(Calendar.DAY_OF_YEAR)$5 ==> 285jshell> Calendar.getInstance().get(Calendar.HOUR)HOUR          HOUR_OF_DAY   jshell> Calendar.getInstance().get(Calendar.HOUR))$6 ==> 10

222537_c6bf_854081.png

留图纪念。

 

有了这玩意以后忘记哪个语法了,或者临时做个小测试,验证个小思路,sublist,subStr这样子的,不用再费劲建个class了。

转载于:https://my.oschina.net/ois/blog/757157

你可能感兴趣的文章
TX Text Control文字处理教程(3)打印操作
查看>>
CENTOS 7 如何修改IP地址为静态!
查看>>
MyCat分片算法学习(纯转)
查看>>
IO Foundation 3 -文件解析器 FileParser
查看>>
linux学习经验之谈
查看>>
mysqld_multi实现多主一从复制
查看>>
中介模式
查看>>
JS中将变量转为字符串
查看>>
servlet笔记
查看>>
JVM(五)垃圾回收器的前世今生
查看>>
Spring Boot 自动配置之@EnableAutoConfiguration
查看>>
web前端笔记
查看>>
finally知识讲解
查看>>
Matplotlib绘图与可视化
查看>>
openstack ocata版(脚本)控制节点安装
查看>>
【微信公众号开发】获取并保存access_token、jsapi_ticket票据(可用于微信分享、语音识别等等)...
查看>>
datatable 获取最大值
查看>>
sqlserver2012一直显示正在还原(Restoring)和从单用户转换成多用户模式(单用户连接中)...
查看>>
spark复习总结02
查看>>
李瑞红201771010111《第九周学习总结》
查看>>