javacpp-presets  by bytedeco

Java configuration/interface classes for native C++ libs

Created 11 years ago
2,782 stars

Top 17.1% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides Java bindings for a vast array of native C/C++ libraries, enabling Java developers to leverage powerful C/C++ functionalities like computer vision, machine learning, and multimedia processing directly within their Java applications. It targets developers needing to integrate complex native libraries without writing JNI code themselves.

How It Works

JavaCPP Presets uses a parser to translate C/C++ header files into Java interface classes. These interfaces are then used by a generator and native C++ compiler to produce JNI libraries. Helper classes simplify the integration and usage of these native functionalities within the Java ecosystem, including Android. This approach automates the often complex and error-prone process of JNI development.

Quick Start & Requirements

  • Installation: Add the relevant org.bytedeco:<moduleName>-platform dependency to your Maven, Gradle, or Leiningen project.
  • Prerequisites: Java SE 7 or newer. For Android development, Android SDK API 24 or newer is required.
  • Customization: Binaries can be filtered by platform using the javacpp.platform system property (e.g., -Djavacpp.platform=linux-x86_64).
  • Documentation: Wiki and Discussion Group.

Highlighted Details

  • Supports over 50 popular C/C++ libraries including OpenCV, FFmpeg, TensorFlow, PyTorch, CUDA, and more.
  • Cross-platform builds for Android, iOS, Linux, macOS, and Windows.
  • Automated native library installation via Maven build or cppbuild.sh scripts.
  • Includes options for GPU acceleration (e.g., CUDA) and Python integration.

Maintenance & Community

The project is actively maintained by Samuel Audet and welcomes community contributions. Discussion occurs via a Google Groups mailing list.

Licensing & Compatibility

The project itself is licensed under Apache License 2.0. However, the included presets inherit the licenses of the underlying C/C++ libraries they wrap, which may include restrictive licenses (e.g., GPL, commercial licenses for some SDKs). Users must verify compatibility with their specific use case and the licenses of individual wrapped libraries.

Limitations & Caveats

The maturity and quality of presets can vary between different C/C++ libraries. Some complex C++ features might not be perfectly translated by the parser, requiring manual adjustments or reference to original C++ documentation. Building from source requires a robust build environment setup.

Health Check
Last Commit

4 days ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
20
Star History
14 stars in the last 30 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic), Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), and
4 more.

kaldi by kaldi-asr

0.1%
15k
Speech recognition toolkit for Linux, macOS, Cygwin, and Windows
Created 10 years ago
Updated 1 month ago
Feedback? Help us improve.