Reputation: 25
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
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
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