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

Example for Gradle #32

Open
angusholder opened this issue Oct 20, 2023 · 1 comment
Open

Example for Gradle #32

angusholder opened this issue Oct 20, 2023 · 1 comment

Comments

@angusholder
Copy link

I was trying to use this with Gradle, so added a dependency like I typically would:

implementation("com.ngrok:ngrok-java-native:0.4.0")

This appeared to work correctly, however when I started the program, I got an obscure NullPointerException, which turned out to be because the ngrok_java.dll file was missing. I eventually worked out that I was missing a "classifier", like so:

implementation("com.ngrok:ngrok-java-native:0.4.0:windows-x86_64")

and this solved it. Maybe you could add a Gradle example to the README too?

I also have a question: how can I make a program that supports multiple platforms? ie: a single .jar file containing the native binaries for multiple platforms. I tried listing multiple classifiers like this

implementation("com.ngrok:ngrok-java-native:0.4.0:windows-x86_64")
implementation("com.ngrok:ngrok-java-native:0.4.0:linux-android-aarch_64")

but it gives a compile error due to duplicate classes.

@nikolay-ngrok
Copy link
Contributor

nikolay-ngrok commented Oct 23, 2023

Hello @angusholder ,

Thanks for reporting this issue. I've created a PR #33 with update to the README.

As for the second part - I'll have to experiment a bit, but potentially you would need repackage our multiple classified jars into a single one and potentially rewrite the native loader. We have a task on the backlog to create a multi-platform jar, but we haven't completed it yet.

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