J2V8 icon indicating copy to clipboard operation
J2V8 copied to clipboard

Running in IDE on Windows, but not working when deployed on Linux ?

Open bercy46 opened this issue 7 years ago • 3 comments

Hi,

On Windows, I add the dependency for J2V8 in my pom.xml, and then I can run my application within the Eclipse IDE just fine (I tested with version 4.6).

My goal is to run on Linux. So, I copy the J2V8 jar over to my Ubuntu along with the application using it. When I try to start it with the command line, e.g. java -cp (the J2V8 jar is in the classpath), it fails with

java.lang.IllegalStateException: J2V8 native library not loaded at com.eclipsesource.v8.V8.checkNativeLibraryLoaded(V8.java:195) at com.eclipsesource.v8.V8.createV8Runtime(V8.java:149) at com.eclipsesource.v8.V8.createV8Runtime(V8.java:110) ... Caused by: java.lang.UnsatisfiedLinkError: Could not load J2V8 library. Reasons: no j2v8_linux_i386 in java.library.path

    at com.eclipsesource.v8.LibraryLoader.loadLibrary(LibraryLoader.java:75)
    at com.eclipsesource.v8.V8.load(V8.java:71)
    at com.eclipsesource.v8.V8.createV8Runtime(V8.java:145)
    ... 14 more

I also tried extracting the _x86_64.so library to the directory where my main class is, and to my libs directory, but I get the same result. I also find it odd that it's looking for the i386 version ????

What are the steps needed to run J2V8 on my Ubuntu 12.04 linux ?

Thanks.

bercy46 avatar Mar 29 '18 11:03 bercy46

It looks like you need another artifact (for Linux) instead of Windows.

I have very similar issue when running my JUnit test in android project:

For Android app I use:

compile 'com.eclipsesource.j2v8:j2v8:4.8.0@aar'

But to run the tests on Mac I need:

compile 'com.eclipsesource.j2v8:j2v8_macosx_x86_64:4.6.0'

There several issues about it, e.g. https://github.com/eclipsesource/J2V8/issues/342

AlexTrotsenko avatar Apr 03 '18 13:04 AlexTrotsenko

I figured what was wrong, I was attempting to run on an old 32-bit Ubuntu... J2V8 worked fine when deployed on a 64-bit linux.

On Tue, Apr 3, 2018 at 9:15 AM, Alex Trotsenko [email protected] wrote:

It looks like you need another artifact (for Linux) instead of Windows.

I have very similar issue when running my JUnit test in android project:

For Android app I use:

compile 'com.eclipsesource.j2v8:j2v8:4.8.0@aar'

But to run the tests on Mac I need:

compile 'com.eclipsesource.j2v8:j2v8_macosx_x86_64:4.6.0'

There several issues about it, e.g. #342 https://github.com/eclipsesource/J2V8/issues/342

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eclipsesource/J2V8/issues/389#issuecomment-378245884, or mute the thread https://github.com/notifications/unsubscribe-auth/AGR-qCtHCEl9-Gn1ATLuIbPCceuLM8KMks5tk3YEgaJpZM4TAK1R .

bercy46 avatar Apr 03 '18 15:04 bercy46

Btw, for development/testing purpose I got following reply today. I will try it meanwhile.

AlexTrotsenko avatar Apr 05 '18 14:04 AlexTrotsenko