J2V8 icon indicating copy to clipboard operation
J2V8 copied to clipboard

Build for windows does not work "libplatform/libplatform.h": No such file or directory

Open MinePlay96 opened this issue 5 years ago • 10 comments
trafficstars

hello i am currently trying to build J2V8 with node js 7.4 but i always get the error.

C:\Users\leons\Documents\GitHub\J2V8\jni\com_eclipsesource_v8_V8Impl.cpp(12): fatal error C1083: Datei (Include) kann n icht geöffnet werden: "libplatform/libplatform.h": No such file or directory [C:\Users\leons\Documents\GitHub\J2V8\cmak e.out\win32.x64\j2v8.vcxproj]

i am now helpless what to do.

i would also be satisfied if i would get a pre-built version for Windows x32 which contains at least node 6. (node 13 would be even better ;) )

MinePlay96 avatar Jan 12 '20 15:01 MinePlay96

Hi @MinePlay96,

Currently, The latest version of J2V8 does not support the Windows platform. see for details: #441.

Have you tried that build (https://search.maven.org/search?q=a:j2v8_win32_x86_64) from Maven central?

ahmadov avatar Feb 07 '20 11:02 ahmadov

@ahmadov - I am facing the same error even on linux platform.

fatal error: libplatform/libplatform.h: No such file or directory
 #include <libplatform/libplatform.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

rohitcelestial avatar Mar 03 '20 20:03 rohitcelestial

Hi @rohitcelestial could you please try that https://github.com/eclipsesource/J2V8/issues/487#issuecomment-554473647

ahmadov avatar Mar 04 '20 00:03 ahmadov

Hi @ahmadov - i solved it by just using this Fork https://github.com/drywolf/J2V8

MinePlay96 avatar Mar 04 '20 05:03 MinePlay96

@ahmadov - Thanks, I was able to build but it seems it's only V8 (which I understand is the project) but I was looking for NodeJS operations like require etc.

final NodeJS nodeJS = NodeJS.createNodeJS();

results in UnsupportedOperationException: startNodeJS Not Supported

rohitcelestial avatar Mar 05 '20 10:03 rohitcelestial

Yes, the newer version of J2V8 dropped the NodeJS support. So, you cannot use NodeJS require method but you can implement your own one. You can register a JavaCallback for your method and implement native support, see:

  1. https://github.com/eclipsesource/J2V8/blob/master/src/main/java/com/eclipsesource/v8/V8.java#L797
  2. https://github.com/eclipsesource/J2V8/blob/master/src/main/java/com/eclipsesource/v8/JavaCallback.java

ahmadov avatar Mar 05 '20 13:03 ahmadov

@MinePlay96 How did you manage the build? Which j2V8 and NodeJs versions you were able to use? I want to use a higher node version too. I am not sure what was the last version of j2v8 that supported Node.

mkshiblu avatar Jun 01 '20 08:06 mkshiblu

Following the build steps I also get this same failure on MacOS. I'm choosing the option from the interactive build menu and have followed the steps in the BUILD guide.

Is there any resolution to this problem? The fork mentioned earlier is very old now as is the published MacOS version.

longwa avatar Nov 23 '21 15:11 longwa

The build ends up looking for this include directory that doesn't exist:

-I/Users/along/github/J2V8/v8.out/include

I see some of the includes in:

./node/deps/v8/include
./node/deps/v8_inspector/include

But changing those in the CMake just results in compile errors.

Is MacOS x86 even a supported build anymore?

longwa avatar Nov 23 '21 15:11 longwa

Is MacOS x86 even a supported build anymore?

I don't think so. Please refer to Reduce the scope of the J2V8 project for detail.

I built a private build of v6.2.0 for Linux and Windows in this January. It wasn't a happy thing to me. So I didn't bother building the Mac OS one. You are welcome trying the private build on Linux or Windows.

If you are keen on something equivalent on Mac OS, so far the only option seems to be Javet.

caoccao avatar Nov 24 '21 01:11 caoccao