Web3j web3j = Web3j.build(new HttpService("http://localhost:8545"));
ECKeyPair keyPair = Keys.createEcKeyPair();
Credentials credentials = Credentials.create(keyPair);
TransactionReceipt transactionReceipt = Transfer.sendFunds(
web3j, credentials,
BigDecimal.valueOf(1.0), Convert.Unit.ETHER);
YourSmartContract contract = YourSmartContract.deploy(
web3j, credentials,
GAS_PRICE, GAS_LIMIT,
<dependency>
<groupId>org.web3j</groupId>
<artifactId>core</artifactId>
<version>4.8.0</version>
</dependency>