HubSpot/J2V8

Name: J2V8

Owner: HubSpot

Description: Java Bindings for V8

Forked from: eclipsesource/J2V8

Created: 2016-11-21 19:33:28.0

Updated: 2016-11-21 19:33:30.0

Pushed: 2016-09-30 15:22:11.0

Homepage:

Size: 11839

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

J2V8

Build Status Maven Central

J2V8 is a set of Java bindings for V8. J2V8 focuses on performance and tight integration with V8. It also takes a 'primitive first' approach, meaning that if a value can be accessed as a primitive, then it should be. This forces a more static type system between the JS and Java code, but it also improves the performance since intermediate Objects are not created.

We developed J2V8 as a high performance engine for our multi-platform mobile toolkit tabris.js and it is a great choice for executing JavaScript on Android devices.

Building J2V8

Building J2V8 requires building both the native parts and the Java library (.jar file). To build the native parts we first build node.js as a library and then statically link J2V8 to that. The Java parts are built with maven.

Building on MacOS
./build-node.sh
./buildJ2V8_macos.sh
 clean verify
Building on Linux
rt CCFLAGS="${CCFLAGS} -fPIC" 
rt CXXFLAGS="${CXXFLAGS} -fPIC" 
rt CPPFLAGS="${CPPFLAGS} -fPIC" 
./build-node.sh
r /data/jenkins/node .
ni
-I../node -I../node/deps/v8 -I../node/deps/v8/include \
-I../node/src -I /data/jenkins/tools/hudson.model.JDK/jdk-7/include/ \
-I /data/jenkins/tools/hudson.model.JDK/jdk-7/include/linux  \
com_eclipsesource_v8_V8Impl.cpp -std=c++11 -fPIC -shared -o libj2v8_linux_x86_64.so \
-Wl,--whole-archive ../node/out/Release/libnode.a  -Wl,--no-whole-archive \
-Wl,--start-group \
                  ../node/out/Release/libv8_libbase.a \
                  ../node/out/Release/libv8_libplatform.a \
                  ../node/out/Release/libv8_base.a \
                  ../node/out/Release/libv8_nosnapshot.a \
                  ../node/out/Release/libuv.a \
                  ../node/out/Release/libopenssl.a \
                  ../node/out/Release/libhttp_parser.a \
                  ../node/out/Release/libgtest.a \
                  ../node/out/Release/libzlib.a \
                  ../node/out/Release/libcares.a \
-Wl,--end-group \
-lrt -D NODE_COMPATIBLE=1
clean verify

This will build J2V8 with node.js support. To disable this support, remove the -D NODE_COMPATIBLE=1 option.

Tutorials

Articles

Presentations

Other Resources

Here is a list of articles I've written on J2V8 http://eclipsesource.com/blogs/tag/j2v8/.

Who is using J2V8?

Here are some projects that use J2V8:

License

The code is published under the terms of the Eclipse Public License, version 1.0.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.