You can do this using a wrapper. To build a wrapper use the following code:
solc YourSmartContract.sol --bin --abi --optimize -o ./
web3j solidity generate YourSmartContract.bin YourSmartContract.abi -o /path/to/yourSrc/main/java -p your.application.id
After this, a java file will be created and then you can call the commands.