{"id":23383173,"url":"https://github.com/stwind/gradle-jni","last_synced_at":"2026-03-10T16:03:36.709Z","repository":{"id":59154735,"uuid":"263598862","full_name":"stwind/gradle-jni","owner":"stwind","description":"Sample project setup for working with Java Native Interface with Gradle","archived":false,"fork":false,"pushed_at":"2020-05-15T13:19:21.000Z","size":74,"stargazers_count":21,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T21:51:08.343Z","etag":null,"topics":["gradle","java","jni"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-13T10:33:21.000Z","updated_at":"2025-02-27T02:54:55.000Z","dependencies_parsed_at":"2022-09-13T17:51:53.645Z","dependency_job_id":null,"html_url":"https://github.com/stwind/gradle-jni","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stwind%2Fgradle-jni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stwind%2Fgradle-jni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stwind%2Fgradle-jni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stwind%2Fgradle-jni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stwind","download_url":"https://codeload.github.com/stwind/gradle-jni/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322600,"owners_count":21084337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gradle","java","jni"],"created_at":"2024-12-21T22:18:42.234Z","updated_at":"2026-03-10T16:03:31.677Z","avatar_url":"https://github.com/stwind.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JNI Project With Gradle \n\nA sample project setup/workflow for building JNI libraries (C++) with Gradle for references.\n\nFeatures\n\n* [Automatic JNI header generation](jni-lib/build.gradle#L24)\n* [Load shared libraries embeded in Jar](jni-lib/src/main/java/jni/Tools.java#L5)\n* [Unittest JNI with JUnit 5](jni-lib/build.gradle#L48)\n\nTested on\n\n* Mac OS X\n* Ubuntu (focal)\n\n## Prerequisite\n\n* OpenJDK 11+\n* CMake 3.13+\n\n## Building\n\nClone the repo\n\n```sh\n$ git clone https://github.com/stwind/gradle-jni.git\n$ cd gradle-jni\n$ ./gradlew run\n```\n\nThe output should be something like\n\n```\nDownloading https://services.gradle.org/distributions/gradle-6.4-bin.zip\n.........10%..........20%..........30%..........40%.........50%..........60%..........70%..........80%.........90%..........100%\n\nWelcome to Gradle 6.4!\n\nHere are the highlights of this release:\n - Support for building, testing and running Java Modules\n - Precompiled script plugins for Groovy DSL\n - Single dependency lock file per project\n\nFor more details see https://docs.gradle.org/6.4/release-notes.html\n\nStarting a Gradle Daemon (subsequent builds will be faster)\n\n\u003e Task :jni-lib:compileJNI\n-- The CXX compiler identification is GNU 9.3.0\n-- Check for working CXX compiler: /usr/bin/c++\n-- Check for working CXX compiler: /usr/bin/c++ -- works\n-- Detecting CXX compiler ABI info\n-- Detecting CXX compiler ABI info - done\n-- Detecting CXX compile features\n-- Detecting CXX compile features - done\n-- Found Java: /usr/lib/jvm/java-13-openjdk-amd64/bin/java (found version \"13.0.3\")\n-- Found JNI: NotNeeded\n-- Configuring done\n-- Generating done\n-- Build files have been written to: /root/gradle-jni/jni-lib/build/natives\nScanning dependencies of target tools\n[ 50%] Building CXX object src/main/cpp/CMakeFiles/tools.dir/tools.cpp.o\n[100%] Linking CXX shared library ../../../lib/libtools.so\n[100%] Built target tools\n\n\u003e Task :jni-runner:run\nfoobar\n\nBUILD SUCCESSFUL in 26s\n6 actionable tasks: 6 executed\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstwind%2Fgradle-jni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstwind%2Fgradle-jni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstwind%2Fgradle-jni/lists"}