I am a Java developer. I want to write a smart contract using Java and deploy it to a private blockchain network.

Does Ethereum provide the facility to write smart contracts using Java language? If yes, how can I do this?


No, the only currently supported languages for contract development are lll (dead), serpent and solidity with the later being most used.


To start you can use web3j. It is Java library that allow the iteration of java application with contracts in the Ethereum network.

It doesn't provide the capability to write contracts in java, but you can interact with contracts written in Solidity.

It generates Smart Contract wrappers in Java from a Solidity compiled binary and ABI file.

Once you've generated the wrapper code with web3j, you will be able to deploy, then call the methods on the above contract example as follows:


SimpleStorage simpleStorage = SimpleStorage.deploy(
    <web3j>, <credentials>, GAS_PRICE, GAS_LIMIT,
    BigInteger.ZERO);  // ether value of contract

TransactionReceipt transactionReceipt = simpleStorage.set(
        new Uint256(BigInteger.valueOf(1000))),

Uint256 result = simpleStorage.get()
  • 1
    Please don't submit link-only answers. Describe the content and how it solves the problem. Jul 8 '17 at 21:58
  • 1
    I think is misleading. You can write your code in a few languages for which an EVM compiler exists, but Java isn't one of them. JavaScript != Java. You can indeed deploy bytecode via JavaScript using Web3 but it seems like we are far away from the original question. Jul 8 '17 at 22:50
  • 2
    @RobHitchens: plesase note this is web3j, not web3 - it is, as described a Java library.
    – jsbueno
    Jul 11 '17 at 16:36
  • 2
    (whoever downvoted this, the answer seems to have improved since)
    – jsbueno
    Jul 11 '17 at 16:36

Currently, Smart Contracts can be written in three languages:

Solidity - Similar to JavaScript

Serpent - Python derivative

LLL(Lisp Like Language) - Similar to Assembly

You can find more information about these languages here.

Solidity is designed especially for writing smart contracts and is the flagship language of Ethereum. You can start reading about it here.


You can not write contracts in Java, but deploying should work with the Ethereum Contract API native in Java. The goal is to ease the integration of Ethereum in a Java project.

  • Easy configuration of the network and keypair use
  • Create an interface for a smart contract
  • Have type safety in regards of input and output values
  • Easy transaction creation
  • Easy synchronization when creating a transaction
  • Transaction creation returns Future, simple calls returns the value itself

On youtube is a short presentation (15 minutes) from the Berlin Ethereum meetup.


It's not out yet but you might be interested in Corda, which is being developed by Mike Hearn and his team on behalf of the R3 consortium. This targets Java developers, and doesn't use a blockchain, as is appropriate for a lot of private blockchain projects in the financial sector.

Per this discussion some code will be released soon: https://m.youtube.com/watch?v=3YTSwB5UrEI

  • 1
    "doesn't use a blockchain, as is appropriate for a lot of private blockchain projects" Upvoted for this.
    – Jesbus
    Apr 13 '19 at 11:32

The ICON blockchain will support java smart contracts in ICON 2.0 due to be released August 2021 and currently running on a testnet.

You can also checkout code examples -> https://github.com/icon-project/java-score-examples.



Jthereum supports writing contracts for the Ethereum blockchain in Java.

It is a commercial product targeted at enterprise use.


The product is currently in beta testing, but is available for download and use at no charge at this time (4/19/2021)

  • 1
    Nice to know, please correct URL to be like <http://jthereum.com> so it is clickable: jthereum.com Apr 20 at 15:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.