web3j icon indicating copy to clipboard operation
web3j copied to clipboard

Version missing error when running web3j truffle

Open Flaxoos opened this issue 4 years ago • 2 comments

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

Flaxoos avatar Oct 18 '21 15:10 Flaxoos

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

jimmyneutront avatar Dec 12 '21 03:12 jimmyneutront

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.

htchaan avatar Aug 22 '22 03:08 htchaan