Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing symbol called #568

Open
MirrorHuang opened this issue Feb 14, 2023 · 2 comments
Open

missing symbol called #568

MirrorHuang opened this issue Feb 14, 2023 · 2 comments

Comments

@MirrorHuang
Copy link

MirrorHuang commented Feb 14, 2023

When I try to do something like this (i.e. basic stuff)…

var java = require("java");  
var list = java.newInstanceSync("java.util.ArrayList");  
list.size(); 

…I get an error like this:

dyld[83934]: missing symbol called

environment

java: v1.8  
node: v16.14.1

Any idea what’s going wrong?

@kernoeb
Copy link

kernoeb commented Jun 21, 2023

I'm able to reproduce this issue when I use Node 16/18 + arch x64 on macOS Monterey : Macbook Pro M1 (ARM).

arch -x86_64 zsh
nvm use 18
node main.js

---> dyld[7497]: missing symbol called

If I build the native module in ARM, and use Node.js ARM (process.arch), it works, but if I build the nodejavabridge in x64 arch, it gives me "missing symbol called" too.

I also tried to build the native module on a real x64 macOS virtual machine, then force use it by patch-packaging the bridge, without success.

Just for context, I'm using pkg, I would like to build a x64 executable and run it with Rosetta.

@kernoeb
Copy link

kernoeb commented Jul 14, 2023

Update :

Thanks to https://groups.google.com/g/node-java/c/Yj4F7Zrbb0k, I succeed to use Java when DYLD_INSERT_LIBRARIES environment variable is set :

process.env.DYLD_INSERT_LIBRARIES = path.join(jrePath, 'lib', 'server', 'libjvm.dylib')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants