Java Jar files

Steps to build and zip Java jar files:

  • It is highly recommended to build the chaincode inside docker containers with the hyperledger fabric runtime environment images to avoid any conflicts with versions of the programming language and the operating systems. For building java for fabric v2.5, hyperledger/fabric-javaenv:2.5 can be used

  • For MAC Users:

    • Navigate to the root of the java source code

    • Use the command to build the .jar file “/gradlew build shadowJar -x test” .jar/.jar(s) will be created in the path “build/libs”

    • Use the command to build the .jar file “/gradlew build shadowJar -x test” .jar will be created in the path “build/libs”

    • If you want to zip the asset-transfer-basic chaincode, select all the .jar files and zip it. For java, .jar files are expected to be present inside the zip.

    • META-INF folder can also be included in the zip files, select all the .jar files

    and META-INF folder and zip it.

Last updated