Code Monkey home page Code Monkey logo

jshellstandalone's Introduction

JShell Standalone

Provides a standalone version of the JShell REPL. Anything needed to run JShell independently is contained, so there is no need to install the full JDK. A minimal Java runtime is embedded and compressed using the jlink tool.

This minimal version consists only of the modules necessary to run JShell: "java.base", "jdk.zipfs" and "jdk.jshell". However the user can manually provide any JDK or custom module on startup with --add-module.

Note that the startup time of JShell 10 was significantly improved.

Caveat: The default JShell editor is not available. An editor can be set in JShell e.g. with /set editor C:/Program Files (x86)/Notepad++/notepad++.exe

Download

JDK 11+28

OS Size JDK Download
Windows 24.3 MB OpenJDK JShell_jdk-11.28_windows.zip
Linux 26.4 MB OpenJDK JShell_jdk-11.28_linux.zip

JDK 10+46

OS Size JDK Download
Windows 23.6 MB OracleJDK JShell_jdk-10.46_windows.zip
Linux 26.2 MB OpenJDK JShell_jdk-10.46_linux.zip

JDK 9+180

OS Size JDK Download
Windows 23.0 MB OracleJDK JShell_jdk-9.180_windows.zip
Linux 25.4 MB OpenJDK JShell_jdk-9.180_linux.zip

Build

Windows

  • Checkout this repository. That directory will be referenced as <repository-path>

  • Install Java JDK 9 or higher

  • Set environment variable %JAVA_HOME% to the Java installation directory. Replace with the installed version:

    set JAVA_HOME = C:\PROGRA~1\java\jdk-<version>

  • Add %JAVA_HOME% to the %PATH%, if it is not already:

    set PATH = "%PATH%;%JAVA_HOME%"

  • Open the command line

  • Check if Java is accessible with java -version

  • Change directory to <repository-path>

  • Compile the project to <repository-path>/mods/com.standalone.jshell:

    javac -d ./mods/com.standalone.jshell ./src/com.standalone.jshell/module-info.java ./src/com.standalone.jshell/com/standalone/jshell/JShellStandalone.java

    If successful, the compiled files can be found in <repository-path>/mods. JShellStandalone.java is only used to have something to compile. More importantly the module-info.java contains dependencies on "jdk.zipfs" and jdk.jshell".

  • Bundle the Java runtime (semicolon as path separator):

    jlink --module-path "%JAVA_HOME%/jmods;./mods" --add-modules com.standalone.jshell --output ./target --compress 2 --strip-debug -exclude-files *.diz --no-header-files --no-man-pages

    If successful, the binaries can be found in <repository-path>/target/bin.

  • Run <repository-path>/target/bin/jshell.exe

Linux

  • Checkout this repository. That directory will be referenced as <repository-path>

  • Install Java 9 or higher. E.g. How to manually install Java on Ubuntu.

  • Set the installed Java to default, check with java -version

  • In the terminal, change directory to <repository-path>

  • Compile the project to <repository-path>/mods/com.standalone.jshell:

    javac -d ./mods/com.standalone.jshell ./src/com.standalone.jshell/module-info.java ./src/com.standalone.jshell/com/standalone/jshell/JShellStandalone.java

    If successful, the compiled files can be found in <repository-path>/mods. JShellStandalone.java is only used to have something to compile. More importantly the module-info.java contains dependencies on "jdk.zipfs" and jdk.jshell".

  • Bundle the Java runtime (colon as path separator):

    jlink --module-path $JAVA_HOME/jmods:./mods --add-modules com.standalone.jshell --output ./target --compress 2 --strip-debug --exclude-files *.diz --no-header-files --no-man-pages

    If successful, the binaries can be found in <repository-path>/target/bin.

  • Run jshell in <repository-path>/target/bin/

jshellstandalone's People

Contributors

shathor avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.