Questions tagged [j2v8]

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.

41 questions
13
votes
1 answer

How to use NodeJS in Android using J2V8

I have created code for android using J2V8 library for executing nodejs script in android mobile. but it gives me error when i run application. Gradle dependencies compile 'com.eclipsesource.j2v8:j2v8:4.6.0@aar' Code ... @Override protected void…
asissuthar
  • 2,078
  • 1
  • 15
  • 29
7
votes
1 answer

execute function from .js with J2V8

I am using J2V8 for execute JavaScript code on Android. In my Java code, can I access and execute JavaScript functions of a separate .js file? If it is possible, how can I do that?
konbernu
  • 147
  • 1
  • 4
  • 12
7
votes
0 answers

Unload native library

TLDR; Is there any way to tell java to UN-load a native library so that I can re-load it? (I understand it can only be loaded in a single class loader. See below). I know it's unloaded when the classloader is garbage collected, but I've had no…
StormeHawke
  • 5,987
  • 5
  • 45
  • 73
5
votes
1 answer

How to compile different flavors while building a fat jar using Gradle

I want to include the Java Bindings for V8 ("J2V8") in a Java project. The reasons are that (i) the V8 JavaScript engine is much faster then the JavaScript engine shipped with the JRE and (ii) the library I am using is available in JavaScript only…
koppor
  • 19,079
  • 15
  • 119
  • 161
5
votes
1 answer

J2V8 and Stetho

I have an Android app using J2V8 and want to use Stetho to create a debug bridge I can use in Chrome dev tools. Is there any documentation on how to connect Stetho to the V8 runtime I'm using ?
Avi Brenner
  • 151
  • 7
5
votes
2 answers

How to debug J2V8 in Android with chrome developer tools?

A similar question has been asked before, but had no traction. Clearly, it is possible but it is by no means clear how to do it in our own non-tabris Android app. The best documentation we have on the matter is this commit, but I tried…
Brad Pitcher
  • 1,693
  • 17
  • 21
5
votes
1 answer

Eclipse Auto Deploy Doesn't Include Native Libraries

I have a Java webapp in eclipse. I have auto-deploy enabled, so whenever I make a change, eclipse automatically redeploys the webapp to my local Tomcat server, and all I have to do is refresh the page. This has worked fine and dandy up until…
Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
4
votes
1 answer

Couldn't load (find) j2v8_android_x86 library

I have a gradle project that uses j2v8_android 2.2.1 library (which provides Java bindings for V8 JS engine - android port). Unfortunately, after executing the project (build succeeds without issues), I get an exception related to missing…
Bart Platak
  • 4,387
  • 5
  • 27
  • 47
3
votes
2 answers

Installing/Using J2V8 in Android Studio

I am new to Android Studio development, as well as gradle and j2v8. I have a sample Hello World app and want to use j2v8 in it (just for curiosity). I have the following in my application gradle dependencies { compile fileTree(dir: 'libs',…
user2680690
  • 31
  • 1
  • 2
3
votes
3 answers

A java application with J2V8 crashes when an exception happened in a some deferred section (e.g. setTimeout or process.nextTick)

I use amazing J2V8 java library which allows execute any Javascript code in your Java application furthermore it can integrates a nodeJS engine. But i have encountered with a next issue. This code interrupts a Java application immediately after…
3
votes
1 answer

Does J2V8 uses android system V8 or compiles and provides own one?

I'd like to use android system V8 to run JS and i'd like to avoid cross-compiling V8 and providing it as .so in my app to reduce apk size. Does J2V8 use system one or compiles and provides own?
4ntoine
  • 19,816
  • 21
  • 96
  • 220
3
votes
0 answers

build J2V8 with android sdk/ant. Exception: J2V8 Native library not loaded

I build my application with android sdk/ant (in ubuntu terminal). J2V8 is in the dependencies and it is built. When I try to run my application and I try to create a V8 runtime I get this: Exception: J2V8 Native library not loaded. My question is:…
konbernu
  • 147
  • 1
  • 4
  • 12
3
votes
1 answer

Working with promises in J2V8

Im trying to use the inline-css NPM package in a Java project through J2V8 to inline stylesheets into style attributes. final NodeJS nodeJS = NodeJS.createNodeJS(); final V8Object inlineCss = nodeJS.require(new File( …
Mato
  • 830
  • 2
  • 9
  • 21
2
votes
0 answers

Server Stopped While Executing The Invocable On Second Request

While executing the following line my server halted for the second request. Invocable invocableEngine = load(); Object o1 = invocableEngine.invokeFunction("add",5,6,jsonObj); private static Invocable invocable =null; public static Invocable…
user1023675
  • 289
  • 1
  • 4
  • 13
2
votes
3 answers

How to include dependencies in J2V8

How to include dependencies in J2V8? I would like to use certain dependencies in the javascript file for instance the crypto package. var crypto = require('crypto'); function foo(){ return…
bj4947
  • 880
  • 11
  • 32
1
2 3