I am using the readme guide https://github.com/web3j/web3j. What I am interested is developing smart contracts from my host with java + web3j to private ethereum network which runs on my virtual machine. There are such lines:

Web3j web3 = Web3j.build(new HttpService());  // defaults to http://localhost:8545/
Credentials credentials = WalletUtils.loadCredentials("password", "/path/to/walletfile");

So the question is - how should I create this wallet? Should I generate account on my VM and then copy wallet.json file to my host?

2 Answers 2


The wallet file is your encrypted private key file. you have the choice to :

1-use the private key file from the web3js or ethereum keystore.

AppData/Ethereum/keystore (geth)
AppData/Web3/keys (eth)

you will find something like :


use it a second parameter in WalletUtils.loadCredentials

2- creating the wallet fine using web3j

String fileName = WalletUtils.generateNewWalletFile(
        "your password",
        new File("/path/to/destination"));

3-use Myetherwallet to export your 'wallet' as a json file.


you can create it using https://www.myetherwallet.com/ and then add staticly you account address in the genesis file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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