Cormanz / Javet

Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding Node.js and V8 in Java.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Javet

Maven Central Discord Donate Linux Build

Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding Node.js and V8 in Java.

If you like my work, please Star this project. And, you may follow me @sjtucaocao, or visit http://caoccao.blogspot.com/. And the official support channel is at discord.

💖 If you use Mac OS (x86_64), please be aware that the Mac OS (x86_64) build will discontinue anytime because my MacBook Air mid-2012 will be soon deprecated by new version of V8. Please donate to support me purchasing a new Mac OS (x86_64) device. Or, if you have a retired Mac OS (x86_64) device and are fine with mailing it to me, that will also be great. Thank you for supporting Javet.

💖 If you use Mac OS (arm64), unfortunately there is no Mac OS (arm64) build because I don't have any Mac OS (arm64) device. Please donate to support me purchasing a new Mac OS (arm64) device.

Major Features

  • Linux + Mac OS + ️Windows (x86_64)
  • Node.js v14.17.6 + V8 v9.4.146.16 (Which Node.js version do you prefer?)
  • Dynamic switch between Node.js and V8 mode (Which mode do you prefer?)
  • Polyfill V8 mode with Javenode
  • V8 API exposure in JVM
  • JavaScript and Java interop
  • Native BigInt and Date
  • Javet engine pool
  • Easy spring integration
  • Live debug with Chrome DevTools

Quick Start

Dependency

Maven

<!-- Linux or Windows -->
<dependency>
    <groupId>com.caoccao.javet</groupId>
    <artifactId>javet</artifactId>
    <version>0.9.14</version>
</dependency>

<!-- Mac OS (x86_64 Only) -->
<dependency>
    <groupId>com.caoccao.javet</groupId>
    <artifactId>javet-macos</artifactId>
    <version>0.9.14</version>
</dependency>

Gradle Kotlin DSL

implementation("com.caoccao.javet:javet:0.9.14") // Linux or Windows
implementation("com.caoccao.javet:javet-macos:0.9.14") // Mac OS (x86_64 Only)

Gradle Groovy DSL

implementation 'com.caoccao.javet:javet:0.9.14' // Linux or Windows
implementation 'com.caoccao.javet:javet-macos:0.9.14' // Mac OS (x86_64 Only)

Hello Javet

// Node.js Mode
try (V8Runtime v8Runtime = V8Host.getNodeInstance().createV8Runtime()) {
    System.out.println(v8Runtime.getExecutor("'Hello Javet'").executeString());
}

// V8 Mode
try (V8Runtime v8Runtime = V8Host.getV8Instance().createV8Runtime()) {
    System.out.println(v8Runtime.getExecutor("'Hello Javet'").executeString());
}

License

APACHE LICENSE, VERSION 2.0.

Documents

About

Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding Node.js and V8 in Java.

License:Apache License 2.0


Languages

Language:Java 80.1%Language:C++ 15.1%Language:JavaScript 1.1%Language:Python 1.0%Language:C 0.8%Language:Dockerfile 0.8%Language:CMake 0.7%Language:Kotlin 0.2%Language:Shell 0.1%Language:Batchfile 0.1%Language:TypeScript 0.0%