aserg-ufmg/RefDiff

J2V8 native library not loaded

vanilson opened this issue · 5 comments

The following error happens when running RefDiffExample:

Exception in thread "main" 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:125)
	at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:58)
	at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:45)
	at refdiff.parsers.js.JsParser.<init>(JsParser.java:40)
	at refdiff.examples.RefDiffExample.runExamples(RefDiffExample.java:23)
	at refdiff.examples.RefDiffExample.main(RefDiffExample.java:15)
Caused by: java.lang.UnsatisfiedLinkError: Could not load J2V8 library. Reasons: 
	no j2v8_macosx_x86_64 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)
	... 6 more

Environment:

java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
MacOS Mojave - version 10.14.6 
Eclipse Version: 2019-06 (4.12.0)
Build id: 20190614-1200

Hi Vanilson,

Actually I never tested RefDiff in MacOS.
Could you try again with the changes I commited to the repo today?
I added a dependency to j2v8_macosx_x86_64, which was missing in the classpath.

Hi @danilofes,

I found the same issue on Linux. I'm using Ubuntu 18.04 with Eclipse.
All the dependencies are present in classpath, but the error still happening.

It is the same error:

Exception in thread "main" 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:125)
	at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:58)
	at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:45)
	at refdiff.parsers.js.JsPlugin.<init>(JsPlugin.java:43)

Hi @rodrigo-brito,

I changed the version of j2v8_linux_x86_64 and the issue seens to be solved. Could you check again with my last commit from the master branch? Note that you should refresh your classpath (e.g. run ./gradlew eclipse again)

Hi @danilofes, thank you for the support.
I solved the issue by removing Windows and Mac libraries for j2v8 in build.gradle file, purging the Gradle cache and reinstalling the dependencies.

For some reason, the precedence of execution loaded the Windows library instead of the Linux version.

I'm not sure if the issue is fixed but I'm closing it as I'm not able to test in Mac.