Simplified java binding example
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
Java Examples
|
||||
======
|
||||
## ZeroTier with Java via JNI
|
||||
***
|
||||
|
||||
`make shared_jni_lib SDK_JNI=1 SDK_IPV4=1`
|
||||
To get this example project to work, do the following:
|
||||
|
||||
Uses API described in [api/java/README.md]
|
||||
- Copy `src/ZeroTier.java` into `your_project/src/zerotier`
|
||||
- Copy `src/Address.java` into `your_project/src/zerotier`
|
||||
- Copy `libzt.jnilib` or `libzt.so` from `build/` into `your_project/lib`
|
||||
- From libzt main directory, build shared library: `make shared_jni_lib`
|
||||
- Copy the resultant dynamic library (`*.so` or `*.dylib`) from `build/` to this current directory
|
||||
- Change to this directory and `make example_java_app`
|
||||
- Run: `java -cp "." ExampleApp`
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
Upon execution, it will load the libzt dynamic library via the `loadLibrary` method and begin generating an identity.
|
||||
Reference in New Issue
Block a user