This document gives the instruction for installing the Blockchain Commons UR Java library.
We use bc-ur as sub-module so make sure you clone this repo correctly. Command to clone this repo along with all submodules
$ git clone https://github.com/BlockchainCommons/bc-ur-java
$ cd bc-ur-java
$ git submodule init
$ git submodule update --recursiveWe add utility script for installing all dependencies, you can find it at
<platform>/scripts/install_deps.shIf you want to do it manually by yourself, make sure all of following dependencies are installed correctly.
Adopt Open JDK 1.8 is recommended for both MacOS and Linux.
Well tested on Ubuntu 16.04, 18.04 and Debian 9, 10.
Following packages can be installed via
apt-get
- automake
- make
Make sure you have llvm/clang, libc++ and libc++abi installed. All of them with a minimum recommended version 10.
$ wget https://apt.llvm.org/llvm.sh
$ chmod +x llvm.sh
$ sudo ./llvm.sh 10 # version 10
$ sudo apt-get install libc++-10-dev libc++abi-10-devFollowing packages can be installed via
brew
- automake
- make
Working directory:
/android
$ JAVA_HOME="your/java/home" ANDROID_SDK_ROOT="your/android-sdk/home" ./scripts/build.sh --test-only$ JAVA_HOME="your/java/home" ANDROID_SDK_ROOT="your/android-sdk/home" ./scripts/build.sh --bundle-onlyThe
app-release.aarfile would be found inapp/build/outputs/aar. You can compile it as a library in your project.
Working directory:
/java
Run following command for building the dynamic library file.
$ JAVA_HOME="your/java/home" CC="clang-10" CXX="clang++-10" ./scripts/build.shThe dynamic library file would be found at
src/main/libs. You need to install it intojava.library.pathfor JVM can load it at runtime.
$ ./gradlew clean testThe jar file will be bundled by running
$ ./gradlew clean assemble
jarfile just contain all.classfiles for running pure Java, no dynamic library is carried with.