node-java with node-webkit 64-bits on Windows

556 views
Skip to first unread message

Jean-François Héon

unread,
Jan 29, 2015, 1:44:41 PM1/29/15
to node...@googlegroups.com
Greetings,

I am migrating a project, node-webkit & node-java from 32 bits to 64 bits on Windows 7.

I uninstalled Python, node-webkit, node & Java & reinstalled everything using 64 bits versions.

I am not using:
Python 2.7.9
JDK 8u31
nw.js 0.11.6
node-java 0.4.4
(I've got VS express 2012)
I installed Windows 7 64-bit SDK & compiler update for the Windows SDK 7.1 as suggested on the nw-gyp page .

Everything worked fined when I was using the 32-bit stack.

I've got some error rebuilding node-java now. Not sure where to begin to look for a diagnostic. Please help me give useful information.

I can see at some point there's some issue regarding the file 'C:\Users\jeff\.nw-gyp\0.11.6\x64\nw.lib.

I can confirm the file does exists, but I have difficulty getting the system error displayed. Any help or pointers would be appreciated. Thank you.

This is what I've got so far:
C:\dixit-src\trunk>npm --verbose rebuild java --msvs_version=2012
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   '--verbose',
npm verb cli   'rebuild',
npm verb cli   'java',
npm verb cli   '--msvs_version=2012' ]
npm info using n...@1.4.9
npm info using no...@v0.11.13
npm verb node symlink C:\Program Files\nodejs\\node.exe
npm info readInstalled object
npm verb rebuild path, id [ 'C:\\dixit-src\\trunk\\node_modules\\java', 'ja...@0.4.4' ]
npm info build C:\dixit-src\trunk\node_modules\java
npm info preinstall ja...@0.4.4
npm verb linkStuff [ false, false, false, 'C:\\dixit-src\\trunk\\node_modules' ]
npm info linkStuff ja...@0.4.4
npm verb linkBins ja...@0.4.4
npm verb linkMans ja...@0.4.4
npm verb rebuildBundles ja...@0.4.4
npm verb rebuildBundles [ 'find-java-home', 'glob', 'nan' ]
npm info install ja...@0.4.4

> ja...@0.4.4 install C:\dixit-src\trunk\node_modules\java
> nw-gyp rebuild --target=0.11.6

gyp info it worked if it ends with ok
gyp verb cli [ 'node',
gyp verb cli   'c:\\dixit-src\\trunk\\node_modules\\nw-gyp\\bin\\nw-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--target=0.11.6' ]
gyp info using nw-...@0.12.4
gyp info using no...@0.11.13 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Python27\python.EXE
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.9\r\n"
gyp verb get node dir compiling against --target node version: 0.11.6
gyp verb command install [ '0.11.6' ]
gyp verb install input version string "0.11.6"
gyp verb installing legacy version? false
gyp verb install installing version: 0.11.6
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 0.11.6
gyp verb build dir attempting to create "build" dir: C:\dixit-src\trunk\node_modules\java\build
gyp verb build dir "build" dir needed to be created? C:\dixit-src\trunk\node_modules\java\build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\dixit-src\trunk\node_modules\java\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\dixit-src\trunk\node_modules\java\config.gypi
gyp verb common.gypi checking for gypi file: C:\dixit-src\trunk\node_modules\java\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn python
gyp info spawn args [ 'c:\\dixit-src\\trunk\\node_modules\\nw-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2012',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\dixit-src\\trunk\\node_modules\\java\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'c:\\dixit-src\\trunk\\node_modules\\nw-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\jeff\\.nw-gyp\\0.11.6\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\jeff\\.nw-gyp\\0.11.6',
gyp info spawn args   '-Dmodule_root_dir=C:\\dixit-src\\trunk\\node_modules\\java',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\dixit-src\\trunk\\node_modules\\java\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\jeff\.nw-gyp\0.11.6
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp verb "Release" dir needed to be created? null
gyp verb copying "nw.lib" for x64 C:\Users\jeff\.nw-gyp\0.11.6\Release\nw.lib
gyp ERR! build error
gyp ERR! stack Error: ENOENT, open 'C:\Users\jeff\.nw-gyp\0.11.6\x64\nw.lib'
gyp ERR! stack     at Error (native)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\dixit-src\\trunk\\node_modules\\nw-gyp\\bin\\nw-gyp.js" "rebuild" "--target=0.11.6"
gyp ERR! cwd C:\dixit-src\trunk\node_modules\java
gyp ERR! node -v v0.11.13
gyp ERR! nw-gyp -v v0.12.4
gyp ERR! not ok

npm verb unsafe-perm in lifecycle true
npm info ja...@0.4.4 Failed to exec install script
npm ERR! ja...@0.4.4 install: `nw-gyp rebuild --target=0.11.6`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ja...@0.4.4 install script.
npm ERR! This is most likely a problem with the java package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     nw-gyp rebuild --target=0.11.6
npm ERR! You can get their info via:
npm ERR!     npm owner ls java
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
"--verbose" "rebuild" "java" "--msvs_version=2012"
npm ERR! cwd C:\dixit-src\trunk
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\dixit-src\trunk\npm-debug.log
npm ERR! not ok code 0

Jean-François Héon

unread,
Jan 29, 2015, 1:49:49 PM1/29/15
to node...@googlegroups.com
Ok as always, I find a mistake in my post moments after posting.

In fact, do not have a C:\Users\jeff\.nw-gyp\0.11.6\x64\ folder.

I have a i32, Release, Deps, tools & src.

So the question becomes, should I have one and if so, what can I change to get it.

Thanks again.


Jean-François Héon

unread,
Jan 29, 2015, 2:24:06 PM1/29/15
to node...@googlegroups.com
Ok, I got it working and I am posting it for others who might find it useful.

I deleted my .nw-gyp folder and rebuilt. This time around the x64 folder got generated. It must have been because I built nw-gyp the first time around before the installation of Windows 7 64-bit SDK.

I've got some other issues now, but I'll investigate more before bugging you again.

Jean-François Héon

unread,
Jan 29, 2015, 4:50:27 PM1/29/15
to node...@googlegroups.com
So the compilation of node-java worked, yeah!

Now I am facing a issue when requiring it.
The high-level exception is
"The specified module could not be found.
c:\dixit-src\trunk\dist\node_modules\java\build\Release\nodejavabridge_bindings.node"

The file does exist for real this time ;)

Trying to debug things with Chrome, I am getting an error in \node_modules\java\lib\nodeJavaBridge.js on this line: var bindings = require(binaryPath);

Is there a way for me to further down to get a diagnostic? There is a number of reason that could cause this error.

Here is the complete stack. I wish I could display the native error.
"Error: The specified module could not be found.
c:\dixit-src\trunk\dist\node_modules\java\build\Release\nodejavabridge_bindings.node
    at Error (native)
    at Module.load (module.js:354:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (C:\dixit-src\trunk\dist\node_modules\java\lib\nodeJavaBridge.js:7:16)
    at Module._compile (module.js:454:26)
    at Object.Module._extensions..js (module.js:472:10)
    at Module.load (module.js:354:32)
    at Function.Module._load (module.js:310:12)"


Jean-François Héon

unread,
Feb 2, 2015, 9:19:44 AM2/2/15
to node...@googlegroups.com
I took a step back and tried to have node-java work directly from node instead of node-webkit.

It worked, so my glitch probably has something to do with nw-gyp.

I'll take my discussion over there and report back when/if I solve my problem.

Jean-François Héon

unread,
Apr 30, 2015, 10:37:52 AM4/30/15
to node...@googlegroups.com
In case anybody is bitten by the same problem.

I'm packaging the JVM with my application to avoid depending on a global JVM.

Moving on from Java 32-bits to 64-bits, the subfolder for the java.dll changed from client to server.

I simply had to adapt the jvm_dll_path.json file to point to the right location.
Reply all
Reply to author
Forward
0 new messages