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

macos electron use node-java-bridge, macos electron use node-java-bridge ,error: Uncaught Exception: Error: java.lang.ClassNotFoundException: io.github.markusjx.bridge.NativeLibrary #111

Open
code565 opened this issue Mar 17, 2025 · 1 comment

Comments

@code565
Copy link

code565 commented Mar 17, 2025

I used 'node java' in 'electron' and after packaging DMG, the button triggered the connection to 'jar', but an error occurred
Image

err:
chunk-libs.befb8490.js:67 Error: Error invoking remote method 'handle-jar': Error: java.lang.ClassNotFoundException: io.github.markusjx.bridge.NativeLibrary
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at crates/java-rs/src/j…_env_wrapper.rs:765
at crates/java-rs/src/j…_env_wrapper.rs:323
at EventEmitter.i.invoke (node:electron/js2c/renderer_init:57:526)
at async i.handleJar (chunk-2e62c82d.7c30320e.js:1:68842)
chunk-dc348ffc.858acd80.js:1

this is mycode
`

Image

`

@MarkusJx
Copy link
Owner

You may want to try setting isPackagedElectron to true when calling ensureJVM, before calling any other methods of this package.

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