Usama Abubakar
Usama Abubakar

Reputation: 25

Deploying Solana Smart Contracts In Java

Can we create smart contracts in Java Programming Language In Solana? I have been studying about it and saw Rust, C and C++ languages. Can we do it in Java?

Upvotes: 0

Views: 1369

Answers (2)

Sasha Shpota
Sasha Shpota

Reputation: 10310

No Java support for creating smart contracts/programs as other answer suggested. But you can communicate with the Solana RPC (read data, sent transactions, etc) using sol4k:

var message = TransactionMessage.newMessage(sender.getPublicKey(), blockhash, instruction);
var transaction = new VersionedTransaction(message);
transaction.sign(sender);
var signature = connection.sendTransaction(transaction);

The are more Java examples in this repository.

Upvotes: 0

Jacob Creech
Jacob Creech

Reputation: 2107

You cannot write smart contacts in Java on Solana. Only Rust and C are supported at this time.

You can send transactions using the java SDK though.

Upvotes: 2

Related Questions