Practical overview
When it fits
Use it when developing Java chaincode for Hyperledger Fabric and you need the shim API, project examples, or instructions for building the Java runtime environment.
Who it is for
- Java developers building smart contracts for Hyperledger Fabric.
- Fabric developers seeking Gradle or Maven contract examples and a Java chaincode runtime build path.
Documented uses
- Use Java shim classes to implement a contract that communicates with Fabric peers.
- Start a Java contract project from Gradle, Maven or Kotlin Gradle examples.
- Build shim artifacts locally and build the documented Java environment Docker image.
- Review a state-based endorsement chaincode example or higher-level integration tests.
Requirements & limits
The project is publicly available as open-source software under the Apache-2.0 license.
- The repository documents Docker, Docker Compose and JDK 11 as build prerequisites.
- It provides separate Gradle and Maven Java contract examples, plus a Kotlin Gradle example.
- The shim API, Docker environment instructions and integration tests are separate repository components.
- The README directs users to a compatibility document for Java runtime and Hyperledger Fabric version details.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Build the Java shim JARs and local Docker environment
Build and install the Java shim artifacts locally, then build the documented Java chaincode environment image.
Before you start
- Docker
- Docker Compose
- JDK 11
- A local clone of the repository
Steps
Clone the fabric-chaincode-java repository and change into its directory.
Run ./gradlew clean build install to build the shim artifacts and install them to the local Maven repository.
Run ./gradlew buildImage to build the hyperledger/fabric-javaenv Docker image locally.
Expected outcome
The shim artifacts are installed in the local Maven repository and the Java chaincode environment image is built locally.
Guide limitations
- This describes local building, not production deployment.
- Consult the compatibility document for Java runtime and Hyperledger Fabric version details.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 2 October 2026
- Original website title
- hyperledger/fabric-chaincode-java · Official homepage title · retained in its source language

