Prerequisites
- JDK 11 or later
- Maven 3.8+ or Gradle 8+
- A Hedera testnet account with ECDSA keys from the developer portal
Step 1: Add the SDK dependency
For Maven, add topom.xml:
build.gradle:
grpc-netty-shaded is the network transport. Without it the SDK compiles, then throws at runtime when you actually try to talk to the network.
Step 2: Credentials
Create a.env file in your project root (and add it to .gitignore):
OPERATOR_ID is your Hedera account ID. OPERATOR_KEY is the DER-encoded ECDSA private key; use the HEX Encoded Private Key value from the developer portal.
Step 3: Connect, query, transfer
Createsrc/main/java/HederaQuickstart.java:
.env loader to your dependencies if you don’t have one. io.github.cdimascio:dotenv-java:3.0.0 is the common pick.
Step 4: Run it
What’s next
Create an Account
Generate a new account programmatically and fund it from your operator.
Create a Token
Mint a native HTS token with custom supply and decimals.
Submit to a Topic
Publish a message to HCS for verifiable, ordered audit logs.
SDK Reference
Full API reference on GitHub.