The answer by @tonykoval works but it had to be quoted properly. When I ran the command as is, I got below error:
Error: Could not find or load main class .properties.file.path=conf.nifi.properties Caused by: java.lang.ClassNotFoundException: /properties/file/path=conf/nifi/properties
After quoting properly like below:
java -cp "lib/bootstrap/*" -D"nifi.properties.file.path"="conf/nifi.properties" org.apache.nifi.authentication.single.user.command.SetSingleUserCredentials "nifiadmin" "nifiadmin123"
it works. I thought of posting in case someone gets this error.