hyperledger-web3j / web3j

Lightweight Java and Android library for integration with Ethereum clients
https://www.web3labs.com/web3j-sdk
Other
5.09k stars 1.68k forks source link

Version missing error when running web3j truffle #1524

Open Flaxoos opened 3 years ago

Flaxoos commented 3 years ago

Exception in thread "main" java.lang.IllegalArgumentException: Input string is NULL or empty

when running the command web3j truffle generate [--javaTypes|--solidityTypes] /path/to/<truffle-smart-contract-output>.json -o /path/to/src/main/java -p com.your.organisation.name with corresponding arguments, I get:

Exception in thread "main" java.lang.IllegalArgumentException: Input string is NULL or empty
        at com.github.zafarkhaja.semver.VersionParser.<init>(VersionParser.java:162)
        at com.github.zafarkhaja.semver.VersionParser.parseValidSemVer(VersionParser.java:194)
        at com.github.zafarkhaja.semver.Version.valueOf(Version.java:265)
        at org.web3j.console.services.Updater.promptIfUpdateAvailable(Updater.java:35)
        at org.web3j.console.Web3jCommand.parse(Web3jCommand.java:108)
        at org.web3j.console.Web3j.main(Web3j.java:18)

Steps To Reproduce

truffle init put contract in contracts folder truffle compile web3j truffle generate [--javaTypes|--solidityTypes] /path/to/<truffle-smart-contract-output>.json -o /path/to/src/main/java -p com.your.organisation.name

Expected behavior

no error produced, java files generated

Actual behavior

error produced, no java files created

jimmyneutront commented 2 years ago

I am running into this issue when I attempt to run any web3j command whatsoever.

htchaan commented 2 years ago

wrong place to report, https://github.com/web3j/web3j-cli

also, try rm ~/.web3j then curl -L get.web3j.io | sh && source ~/.web3j/source.sh and run again, this helped me.