eclipsesource / eclipsesource/J2V8

java.lang.IllegalStateException: When two different JVMs use J2V8

Open
#39 13 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.6k
Forks
387
PR merge metrics
No merged PRs in 30d

Description

Perhaps this issue looks like https://github.com/eclipsesource/J2V8/issues/33, but I have a strange problem.

I'm on Windows OS 64 bits. I can start the Hello sample http://eclipsesource.com/blogs/2015/02/25/announcing-j2v8-2-0/

Now take the same sample add a loop at the end of the main (in order to that the main doesn't finish) :

``` java
import com.eclipsesource.v8.V8;

public class Hello {

public void print(String s) {
System.out.println(s);
}
public void start() {
V8 v8 = V8.createV8Runtime();
v8.registerJavaMethod(this, "print", "print",
new Class[] { String.class });
v8.executeVoidScript("print('Hello, World!');");

// HERE THE MAIN DOESN'T STOP
while(true) {

}
}
public static void main(String[] args) {
new Hello().start();
}
}
```
- Run the Hello with Eclipse (it works)
- Run a second Hello with Eclipse, I have the foolowing problem :

```
Exception in thread "main" java.lang.IllegalStateException: J2V8 native library not loaded.
at com.eclipsesource.v8.V8.checkNativeLibraryLoaded(V8.java:86)
at com.eclipsesource.v8.V8.createV8Runtime(V8.java:74)
at com.eclipsesource.v8.V8.createV8Runtime(V8.java:63)
at Hello.start(Hello.java:10)
at Hello.main(Hello.java:20)
Caused by: java.lang.UnsatisfiedLinkError: Could not load J2V8 library. Reasons:
no j2v8_win32_x86_64 in java.library.path

at com.eclipsesource.v8.LibraryLoader.loadLibrary(LibraryLoader.java:71)
at com.eclipsesource.v8.V8.load(V8.java:49)
at com.eclipsesource.v8.V8.createV8Runtime(V8.java:72)
... 3 more
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.