This is my first time working with the twitter4j API to download twitter tweets. I am using Eclipse->Maven to set dependencies on the twitter4j-core-4.0.4.jar.
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>4.0.4</version>
</dependency>
I run my project jar on a remote university unix system. My runnable jar(27MB) runs fine without any issues but my non-runnable jar(10KB) fails with the below error.
Exception in thread "main" java.lang.NoClassDefFoundError: twitter4j/TwitterException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2570)
at java.lang.Class.getMethod0(Class.java:2813)
at java.lang.Class.getMethod(Class.java:1663)
The "Libraries" and "order and Export" sections in "Java build path" properties of the project do have the Maven Dependencies included.
I cannot submit the the runnable jar as it is too large. I am not sure why the error as I have successfully run other similar programs using external jars before.
I am new to Maven and Twitter4j so I suspect this can be a known issue.
mvn installfrom the command line in the directory where you have pom.xml. Run your jar and see if the issue still exists? - jheimbouch