As the error message says:
No authentication credentials.
From Twitter4J's page Code examples :
To run the sample codes, you need to have OAuth credentials configured in twitter4j.properties. See Twitter4J - Configuration for more details.
You must be logged in to send direct messages to Twitter. You need to set up credentials for authentication using one of the three methods listed on the Twitter4J configuration page before the sample code will work.
- via twitter4j.properties
- via ConfigurationBuilder
- through System Properties
source share