JavaCPP
=======
[![Gitter](https://badges.gitter.im/bytedeco/javacpp.svg)](https://gitter.im/bytedeco/javacpp) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/javacpp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/javacpp) [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.bytedeco/javacpp.svg)](http://bytedeco.org/builds/) [![Build Status](https://travis-ci.org/bytedeco/javacpp.svg?branch=master)](https://travis-ci.org/bytedeco/javacpp) <sup>Commercial support:</sup> [![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/bytedeco/javacpp)
Introduction
------------
JavaCPP provides efficient access to native C++ inside Java, not unlike the way some C/C++ compilers interact with assembly language. No need to invent new languages such as with [SWIG](http://www.swig.org/), [SIP](http://riverbankcomputing.co.uk/software/sip/), [C++/CLI](http://www.ecma-international.org/publications/standards/Ecma-372.htm), [Cython](http://www.cython.org/), or [RPython](https://rpython.readthedocs.io/). Instead, similar to what [cppyy](https://cppyy.readthedocs.io/) strives to do for Python, it exploits the syntactic and semantic similarities between Java and C++. Under the hood, it uses JNI, so it works with all implementations of Java SE, in addition to [Android](http://www.android.com/), [Avian](https://readytalk.github.io/avian/), and [RoboVM](http://robovm.mobidevelop.com/) ([instructions](#instructions-for-android-avian-and-robovm)).
More specifically, when compared to the approaches above or elsewhere ([CableSwig](https://github.com/gccxml/CableSwig), [JNIGeneratorApp](http://www.eclipse.org/swt/jnigen.php), [cxxwrap](http://cxxwrap.sourceforge.net/), [JNIWrapper](http://www.teamdev.com/jniwrapper/), [Platform Invoke](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke), [GlueGen](http://jogamp.org/gluegen/www/), [LWJGL Generator](https://github.com/LWJGL/lwjgl3-wiki/wiki/4.3.-The-Generator), [JNIDirect](http://web.archive.org/web/20050329122501/http://homepage.mac.com/pcbeard/JNIDirect/), [ctypes](http://docs.python.org/library/ctypes.html), [JNA](https://github.com/java-native-access/jna), [JNIEasy](https://github.com/jmarranz/jnieasy), [JniMarshall](http://flinflon.brandonu.ca/Dueck/SystemsProgramming/JniMarshall/), [JNative](http://jnative.free.fr/), [J/Invoke](http://web.archive.org/web/20110727133817/http://www.jinvoke.com/), [HawtJNI](http://fusesource.github.io/hawtjni/), [JNR](https://github.com/jnr/), [BridJ](http://code.google.com/p/bridj/), [CFFI](https://cffi.readthedocs.io/), [fficxx](https://hackage.haskell.org/package/fficxx), [CppSharp](https://github.com/mono/CppSharp), [cgo](https://golang.org/cmd/cgo/), [pybind11](https://pybind11.readthedocs.io/), [rust-bindgen](https://rust-lang.github.io/rust-bindgen/), [Panama Native](http://jdk.java.net/panama/), etc.), it maps naturally and efficiently many common features afforded by the C++ language and often considered problematic, including overloaded operators, class and function templates, callbacks through function pointers, function objects (aka functors), virtual functions and member function pointers, nested struct definitions, variable length arguments, nested namespaces, large data structures containing arbitrary cycles, virtual and multiple inheritance, passing/returning by value/reference/string/vector, anonymous unions, bit fields, exceptions, destructors and shared or unique pointers (via either try-with-resources or garbage collection), and documentation comments. Obviously, neatly supporting the whole of C++ would require more work (although one could argue about the intrinsic neatness of C++), but we are releasing it here as a proof of concept.
As a case in point, we have already used it to produce complete interfaces to OpenCV, FFmpeg, libdc1394, PGR FlyCapture, OpenKinect, videoInput, ARToolKitPlus, Leptonica, Tesseract, GSL, LLVM, HDF5, MKL, CUDA, Caffe, MXNet, TensorFlow, System APIs, and others as part of the [JavaCPP Presets](https://github.com/bytedeco/javacpp-presets) subproject, also demonstrating early parsing capabilities of C/C++ header files that show promising and useful results.
Please feel free to ask questions on [the mailing list](http://groups.google.com/group/javacpp-project) or [the discussion forum](https://github.com/bytedeco/javacpp/discussions) if you encounter any problems with the software! I am sure it is far from perfect...
Downloads
---------
Archives containing JAR files are available as [releases](https://github.com/bytedeco/javacpp/releases).
We can also have everything downloaded and installed automatically with:
* Maven (inside the `pom.xml` file)
```xml
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>1.5.9</version>
</dependency>
```
* Gradle (inside the `build.gradle` file)
```groovy
dependencies {
implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.9'
}
```
* Leiningen (inside the `project.clj` file)
```clojure
:dependencies [
[org.bytedeco/javacpp "1.5.9"]
]
```
* sbt (inside the `build.sbt` file)
```scala
libraryDependencies += "org.bytedeco" % "javacpp" % "1.5.9"
```
Another option available to Gradle users is [Gradle JavaCPP](https://github.com/bytedeco/gradle-javacpp), and similarly for Scala users there is [SBT-JavaCPP](https://github.com/bytedeco/sbt-javacpp).
Required Software
-----------------
To use JavaCPP, you will need to download and install the following software:
* An implementation of Java SE 7 or newer:
* OpenJDK http://openjdk.java.net/install/ or
* Oracle JDK http://www.oracle.com/technetwork/java/javase/downloads/ or
* IBM JDK http://www.ibm.com/developerworks/java/jdk/
* A C++ compiler, out of which these have been tested:
* GNU C/C++ Compiler (Linux, etc.) http://gcc.gnu.org/
* For Windows x86 and x64 http://mingw-w64.org/
* LLVM Clang (Mac OS X, etc.) http://clang.llvm.org/
* Microsoft C/C++ Compiler, part of Visual Studio https://visualstudio.microsoft.com/
* https://docs.microsoft.com/en-us/cpp/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line
To produce binary files for Android 4.0 or newer, you will also have to install:
* Android NDK r7 or newer http://developer.android.com/ndk/downloads/
And similarly to target iOS, you will need to install either:
* Gluon VM http://gluonhq.com/products/mobile/vm/ or
* RoboVM 1.x or newer http://robovm.mobidevelop.com/downloads/
To modify the source code, please note that the project files were created for:
* Maven 3.x http://maven.apache.org/download.html
Finally, because we are dealing with native code, bugs can easily crash the virtual machine. Luckily, the HotSpot VM provides some tools to help us debug under those circumstances:
* Troubleshooting Guide for Java SE with HotSpot VM
* http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/
* http://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/
Getting Started
---------------
To understand how JavaCPP is meant to be used, one should first take a look at the [Mapping Recipes for C/C++ Libraries](https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes), but a high-level overview of the [Basic Architecture](https://github.com/bytedeco/javacpp/wiki/Basic-Architec
没有合适的资源?快使用搜索试试~ 我知道了~
The missing bridge between Java and native C++.zip
共234个文件
java:175个
properties:40个
xml:7个
需积分: 5 0 下载量 159 浏览量
2024-01-01
15:54:57
上传
评论
收藏 459KB ZIP 举报
温馨提示
The missing bridge between Java and native C++
资源推荐
资源详情
资源评论
收起资源包目录
The missing bridge between Java and native C++.zip (234个子文件)
test.bndrun 428B
.gitignore 122B
AdapterTest.h 3KB
BufferTest.h 925B
EnumTest.h 557B
ThreadTest.h 336B
calc.h 89B
Generator.java 255KB
Parser.java 228KB
Loader.java 100KB
Builder.java 70KB
IndexerTest.java 57KB
PointerTest.java 49KB
Pointer.java 42KB
BuildMojo.java 20KB
BytePointer.java 17KB
InfoMap.java 17KB
AdapterTest.java 16KB
ClassProperties.java 15KB
TokenIndexer.java 15KB
PointerPointer.java 14KB
Tokenizer.java 13KB
ByteIndexer.java 12KB
HalfIndexer.java 11KB
BufferTest.java 10KB
Info.java 10KB
Bfloat16Indexer.java 9KB
ULongIndexer.java 9KB
BooleanIndexer.java 9KB
DeclarationList.java 9KB
DoubleIndexer.java 8KB
UShortIndexer.java 8KB
ShortIndexer.java 8KB
FloatIndexer.java 8KB
HyperslabIndexTest.java 8KB
UByteIndexer.java 8KB
LongIndexer.java 8KB
CharIndexer.java 8KB
UIntIndexer.java 8KB
IntIndexer.java 8KB
IntPointer.java 8KB
ByteArrayIndexer.java 8KB
CharPointer.java 8KB
Indexer.java 7KB
CacheMojo.java 7KB
ByteRawIndexer.java 7KB
ClassScanner.java 6KB
Platform.java 6KB
BooleanPointer.java 6KB
PointerScope.java 6KB
DoublePointer.java 6KB
FloatPointer.java 6KB
ShortPointer.java 6KB
ByteBufferIndexer.java 6KB
LongPointer.java 6KB
javacpp.java 6KB
Token.java 6KB
Context.java 6KB
CLongPointer.java 5KB
UnsafeRaw.java 5KB
SizeTPointer.java 5KB
ULongRawIndexer.java 5KB
Adapter.java 5KB
Bfloat16RawIndexer.java 5KB
BooleanRawIndexer.java 5KB
UShortRawIndexer.java 5KB
UIntRawIndexer.java 5KB
DoubleRawIndexer.java 5KB
HalfRawIndexer.java 5KB
UByteRawIndexer.java 5KB
ShortRawIndexer.java 5KB
FloatRawIndexer.java 5KB
HyperslabIndex.java 5KB
CharRawIndexer.java 5KB
LongRawIndexer.java 5KB
IntRawIndexer.java 5KB
ULongBufferIndexer.java 5KB
Bfloat16BufferIndexer.java 5KB
BooleanBufferIndexer.java 5KB
HalfBufferIndexer.java 5KB
ULongArrayIndexer.java 5KB
UShortBufferIndexer.java 5KB
Bfloat16ArrayIndexer.java 5KB
UIntBufferIndexer.java 5KB
UByteBufferIndexer.java 5KB
DoubleBufferIndexer.java 5KB
HalfArrayIndexer.java 5KB
ShortBufferIndexer.java 5KB
FloatBufferIndexer.java 5KB
UShortArrayIndexer.java 5KB
CharBufferIndexer.java 5KB
LongBufferIndexer.java 5KB
UIntArrayIndexer.java 4KB
BooleanArrayIndexer.java 4KB
IntBufferIndexer.java 4KB
UByteArrayIndexer.java 4KB
DoubleArrayIndexer.java 4KB
BuilderTest.java 4KB
FloatArrayIndexer.java 4KB
ShortArrayIndexer.java 4KB
共 234 条
- 1
- 2
- 3
资源评论
暮苍梧~
- 粉丝: 41
- 资源: 258
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功