https://github.com/forge-srl/jjbridge-engine-v8
JJBridge Api implementation using V8 JavaScript engine.
https://github.com/forge-srl/jjbridge-engine-v8
java javascript jjbridge v8 v8-engine v8-javascript-engine
Last synced: 6 months ago
JSON representation
JJBridge Api implementation using V8 JavaScript engine.
- Host: GitHub
- URL: https://github.com/forge-srl/jjbridge-engine-v8
- Owner: Forge-Srl
- License: mit
- Created: 2020-10-26T07:56:18.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-07T08:19:37.000Z (over 3 years ago)
- Last Synced: 2023-07-26T23:51:51.080Z (almost 2 years ago)
- Topics: java, javascript, jjbridge, v8, v8-engine, v8-javascript-engine
- Language: C++
- Homepage:
- Size: 139 MB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# JJBridge V8 Engine
[](https://javadoc.io/doc/srl.forge/jjbridge-engine-v8)




JJBridge is a multi-library project which brings JavaScript execution capabilities to Java.
JJBridge V8 Engine allows using [V8](https://v8.dev/) as the underlying engine for [JJBridge Api](https://github.com/Forge-Srl/jjbridge-api).
## Contents
- [Installation](#installation)
- [Usage](#usage)
- [Initialization](#initialization)
- [Technical details](#technical-details)
- [Licence](#license)## Installation
V8 binaries shipped with JJBridge V8 Engine are platform dependent. To keep the packages small (and to avoid loading the
wrong libraries), we distribute a jar with a different classifier for each platform. Here is how you add it based on
your target platform:- For Linux add this to your pom.xml:
```xml
srl.forge
jjbridge-engine-v8
linux
```
- For macOS add this to your pom.xml:
```xml
srl.forge
jjbridge-engine-v8
macos
```
- For Windows add this to your pom.xml:
```xml
srl.forge
jjbridge-engine-v8
windows
```
- For Android add this to your pom.xml:
```xml
srl.forge
jjbridge-engine-v8
android
aar
```## Usage
The full javadoc is available at .### Initialization
To get a `JSEngine` just use:
```java
JSEngine engine = new V8Engine();
```
You can also pass flags to V8 by calling `V8Engine.setFlags()` before instantiating `V8Engine`.Then instantiate a `JSRuntime` and use JJBridge as usual:
```java
try (JSRuntime runtime = engine.newRuntime()) {
// Do JavaScript things here...
} catch (RuntimeException e) {
}
```### Technical details
JJBridge V8 Engine currently uses V8 version **9.1.269.36**. V8 precompiled binaries are taken from
thus the following platforms are supported:
- Linux (x64)
- Android (x86, x86-64, arm v7, arm v8)
- macOS (x64)
- Windows (x64)## License
See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).