0

I'm currently working on a small project. The first step is to pull tweets from given IDs using the twitter4j API. However, my issue is this error:

TweetCleaner.java:14: error: package twitter4j does not exist

whenever I attempt to compile my code from the command line:

javac -classpath twitter4j-core-4.0.4.jar MyProgram.java

The above command, however, does not do the trick.

I am using Eclipse and I've added the twitter4j jar files to my Libraries.

Any advice would be greatly appreciated.

1 Answers1

0

If you want to pass additional resources from command line for the execution of your class you can use the following command:

java -cp 'MyProgram.jar:<twitter_jar_folder>/twitter4j.jar' main.Main

you can take a look at this question for more: Call "java -jar MyFile.jar" with additional classpath option

Community
  • 1
  • 1
deathyr
  • 433
  • 2
  • 11
  • Don't you have to use the javac command first to compile your code? Also, I just want to make sure I follow. My class is called TweetCleaner. So the command I'd want to use is: > java -cp 'TweetCleaner.jar:/twitter4j.jar' TweetCleaner – Asher Mouat Mar 27 '16 at 13:56