Trying to rebuild with electron - V8 header errors
Platform Windows 7 node-java 0.7.2 electron 1.4.2
using --dist-url to get electron versions of headers
node-gyp rebuild --target=1.4.2 --arch=x64 --dist-url=https://atom.io/download/atom-shell
..\src\utils.cpp(647): error C2039: 'SetHiddenValue': is not a member of 'v8::N umberObject' [C:\excel-converter\node_modules\java\build\nodejavabridge_binding s.vcxproj]
Clearly incompatible - the code's looking for something that's not there. Two choices:
- node-java shouldn't be looking
- electron's V8 should have it
but which is it?
I too am having problems with electron and node-java. See #344 . It feels like the node-java package needs an upgrade to a new version of V8. I tried Node 4.5.0, 6.2.0, and 6.7.0, and all have show-stopping problems. Is a fix to this problem under development?
I'm hoping an upgrade to node-nan will fix the issue. I'm not sure when I'll get around to fixing though.
Do you anticipated days, or many months...? We were hoping to base a very large project on Electron and Java (to legacy jar files), and at the moment, we are completely blocked from moving forward.
I update nan (d071069c0adb04c307f15b2d614e50db0e72fafb) and added node 6 to travis build (c6daaa213a58a669c7b14ac3894d90adfa08f9b9). Can you test your electron build with master? If that works I'll push a new version to npm.
Thanks for taking a look! Unfortunately, it's still not working. I'm getting the same compiler error in the Java bridge code during the electron-rebuild:
../src/javaObject.cpp:350:18: error: ‘class v8::Object’ has no member named ‘SetHiddenValue’
javaObjectObj->SetHiddenValue(Nan::New<v8::String>(V8_HIDDEN_MARKER_JAVA_OBJECT).ToLocalChecked(), Nan::New<v8::Boolean>(true));
^
make: *** [Release/obj.target/nodejavabridge_bindings/src/javaObject.o] Error 1
Some warnings coming up as well.
This happens when I use Node 6.2.0 or 6.7.0.
Here is my package.json:
{
"name": "nava_node_test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"electron": "^1.4.2",
"java": "git+https://github.com/joeferner/node-java.git"
},
"devDependencies": {
"electron-rebuild": "^1.2.1"
}
}
And here is my build script:
#!/bin/bash
npm install
./node_modules/.bin/electron-rebuild
@joeferner You can fix this similarly to how I've fixed it in node-inspector (see https://github.com/node-inspector/v8-profiler/pull/96). NAN probably won't get updated until Node upgrades to V8 5.2 or later.
@enlight Thanks, glad you've got a solution for this! @joeferner , can you put the fix in?
@joeferner can you provide a timeframe on when you can make this fix?
Give it another try. Thanks @enlight for the tip.
https://github.com/joeferner/node-java/commit/b6c0577382e16633b802934ed052bcac90aa195d
Thanks for looking at it, @joeferner . I did the exact same steps as above, but now get this error from the electron-rebuild:
gyp ERR! clean error
gyp ERR! stack Error: ENOTEMPTY: directory not empty, rmdir 'build/Release'
gyp ERR! stack at Error (native)
gyp ERR! System Linux 3.10.0-327.36.1.el7.x86_64
gyp ERR! command "/opt/node-v6.7.0-linux-x64/bin/node" "/u/fisher23/javaNodeTest/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /u/fisher23/javaNodeTest/node_modules/nslog
gyp ERR! node -v v6.7.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Ideas? I tried removing my node_modules directory entirely and running again (twice), and it produces the same error.
John
can you go into node_modules/java directory and manually remove the build directory and run install from there
It's interesting -- it looks like the "electron-rebuild" is giving the error I said above, but it appears that the "fix" is actually still taking place. That is, after the error, I can then run "node_modules/electron/dist/electron index.js", and it runs as expected. That's great, but is there a way to make my build.sh script work, without getting an error message?
@joeferner hi, issue were fixed by applying b6c0577 on electron 1.4.3, thanks~
@vrmerlin when I try this line(node_modules/electron/dist/electron index.js) I'm getting Uncaught Exception: Error: Module version mismatch. Expected 50, got 48.
Maybe this is unrelated but trying to use your instructions so far to get setup.
@gcstang did you run the electron-rebuild command? you need to do that after npm install, but before you run the code. More details are here: https://github.com/electron/electron-rebuild
@joeferner do you know how i can avoid the "directory not empty, rmdir 'build/Release'" error during the electron-rebuild step, without a bunch of manual steps?
@vrmerlin thank you that was it, now to see how to get java output to show in the window.
@vrmerlin thank you very much for your help, I used this to get some output to a index.html file for now and it worked. https://github.com/joeferner/node-java/blob/master/testIntegration/webkit/index.html
@joeferner -- can you help with the problem I described above (avoiding the "directory not empty" error), that's breaking the electron-rebuild step when recompiling the node-java bridge? And, will you be putting in a new version that includes the changes you recently made to fix the compile errors?
@joeferner The code fix you created in the master branch, b6c0577, worked -- will you be cutting a new software version that I can point to? Any thoughts on the "directory not empty" issue?
@vrmerlin while, b6c0577 seems buggy at some point. While I intergate it with newest electron, and frequently comes out Memory Error..About 2-3times per day
@joeferner Is there a path forward here? Are you maintaining node-java still?
@joeferner Would you please help here? Can you at least cut the version that includes the fixes you made?
published 0.8.0