使用 Java REPLJava REPL

chapter1_basics$ java -jar javarepl-428.jar

Welcome to JavaREPL version 428 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40)

Type expression to evaluate, :help for more options or press tab to auto-complete.

Connected to local instance at http://localhost:49659

java> System.out.println("Hello,World")

Hello,World

java> System.out.println("Hello,World"+new Date())

Hello,WorldTue Aug 01 10:08:21 CST 2017

java> System.out.println("Hello,World! "+new Date())

Hello,World! Tue Aug 01 10:08:29 CST 2017

java> 1+1

java.lang.Integer res0 = 2

java>

下载地址:

https://github.com/albertlatacz/java-repl/releases

Java REPL

Travis

GitHub

Docker Pulls

Java REPL is a simple Read-Eval-Print-Loop for Java language.

  • Support for most of Java language constructs
  • Access from console as well as web terminal via browser
  • Create imports, methods, classes, enums and interfaces
  • Load classes from any jar file or directory (including web urls)
  • Load and evaluate expression from file
  • List previous results, imports, created types and methods
  • Show history of evaluations
  • Search and evaluate expression from history
  • Clear and replay previous evaluations
  • Load and evaluate any Java source file
  • Basic code completion for results, classes and methods
  • Coloured output for console and web terminal

Web version is available at www.javarepl.com.

Build

Building Java REPL requires the gradle.

After cloning the git repository, navigate over to it and run:

$ gradle shadowJar

After this completes, the jar completed with bundled dependencies will be located at build/libs/javarepl-dev.jar

Type the following to run

$ java -jar build/libs/javarepl-dev.jar

Releases

Releases are automatically released to

Maven Central

. Configure repository and then add Java REPL as dependency:

com.javarepl

javarepl

SOME_VERSION

Usage

To run Java REPL you need to install Java Development Kit (JDK). Download it from here and follow install instructions. Once JDK is installed and configured, download latest Java REPL release from GitHub or Bintray then run:

$ java -jar javarepl-SOME_VERSION.jar

If this doesn't work try to run pointing directly to java executable within JDK, like so

$ /bin/java -jar javarepl-SOME_VERSION.jar

License

Distributed under the Apache 2.0

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏Android 研究

Android跨进程通信IPC之5——Binder的三大接口

本片文章的主要目的是让大家对Binder有个初步的了解,既然是初步了解,肯定所是以源码上的注释为主,让大家对Binder有一个更直观的认识。PS:大部分注释我是...

1645
来自专栏玩转JavaEE

Spring Cloud中声明式服务调用Feign

前面几篇文章我们详细的介绍了Ribbon、RestTemplate、Hystrix组件,这些组件是我们Spring Cloud中非常基础的组件,小伙伴们在使用的...

80511
来自专栏用户2442861的专栏

CMake使用总结

CMake意为cross-platform make,可用于管理c/c++工程。CMake解析配置文件CMakeLists.txt生成Makefile,相比直...

1201
来自专栏Ryan Miao

Spring Boot文档阅读

原因之初 最初习惯百度各种博客教程,然后跟着操作,因为觉得跟着别人走过的路走可以少走很多弯路,省时间。然而,很多博客的内容并不够完整,甚至错误,看多了的博客甚至...

5987
来自专栏张善友的专栏

Windows Server AppFabric Beta 2 已经发布

Windows Server AppFabric Beta 2是一个包含完全功能的AppFabric版本(This build represents our “...

1815
来自专栏dalaoyang

SpringBoot的国际化使用

在项目中,很多时候需要国际化的支持,这篇文章要介绍一下springboot项目中国际化的使用。 在这个项目中前端页面使用的thymeleaf,另外加入了neko...

49113
来自专栏一个会写诗的程序员的博客

SpringBoot集成日志logback.groovy报错: Groovy classes are not available on the class path. ABORTING INITIAL

SpringBoot集成日志logback.groovy报错: Groovy classes are not available on the class pa...

1063
来自专栏Spring相关

feign中的hytrix和turbin配置

这里我就只讲下怎么注册到dashbord和相关的配置,提供者和消费者等代码可以去下载查看:

1491
来自专栏编程坑太多

springboot(13)国际化

1854
来自专栏后台及大数据开发

CentOS下 elasticsearch集群安装

4.修改/root/elasticsearch-node3/config/elasticsearch.yml 为如下内容(注意红色部分为三个节点不一致的地方)

1142

扫码关注云+社区

领取腾讯云代金券