Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix: Java JAR contains native library twice#430

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MarkReedZ wants to merge1 commit intounum-cloud:main-dev
base:main-dev
Choose a base branch
Loading
fromMarkReedZ:fix_duplicate_so

Conversation

@MarkReedZ
Copy link
Contributor

This PRfixes#314 by excluding the shared/ directory.

Tested with

javac -cp /usr/share/java/junit4.jar:../../build/libs/usearch-2.13.0.jar IndexTest.javajava -cp .:/usr/share/java/junit4.jar org.junit.runner.JUnitCore IndexTest

@MarkReedZ
Copy link
ContributorAuthor

Note that a cleaner fix for this issue would probably be to not copy the dlls and load them fromusearch/shared/

In the build.gradle we copyusearch/shared/* to../ then in the code we load from/usearch. Instead we can remove the copying and load from/usearch/shared/

          NativeUtils.loadLibraryFromJar("/usearch/libusearch.dylib");        } else {          NativeUtils.loadLibraryFromJar("/usearch/libusearch.so");
ashvardanian reacted with thumbs up emoji

@ashvardanian
Copy link
Contributor

The latter sounds like a good plan. I can wait for that patch, if you want to follow up on this branch 🤗

@MarkReedZ
Copy link
ContributorAuthor

Proper fix and verified the jar as in the OP.

System.loadLibrary("usearch");// used for tests. This library in classpath only
}catch (UnsatisfiedLinkErrore) {
try {
if (System.getProperty("os.name").equals("Mac OS X")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we know what this property is equal to on Windows? We should probably link to .dll there.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ashvardanianashvardanianashvardanian approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@MarkReedZ@ashvardanian

[8]ページ先頭

©2009-2025 Movatter.jp