I'm new to java , i tried to use word net for senitment analysis . when i used class of wordnet , i got the following failure in importing
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.lucene.analysis.en.EnglishMinimalStemmer;
import org.apache.stanbol.commons.stanboltools.datafileprovider.DataFileListener;
import org.apache.stanbol.commons.stanboltools.datafileprovider.DataFileTracker;
import org.apache.stanbol.enhancer.engines.sentiment.api.LexicalCategoryClassifier;
import org.apache.stanbol.enhancer.engines.sentiment.api.SentimentClassifier;
import org.apache.stanbol.enhancer.engines.sentiment.util.WordSentimentDictionary;
import org.apache.stanbol.enhancer.nlp.pos.LexicalCategory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.ComponentContext;
all the above imports cannot be resolved like org.apache.felix
, org.apache.lucene
,org.apache.stanbol
,org.osgi
This is because your compiler is not able to find the necessary packages and or libraries that are needed to resolve these imports. These packages must be included in your class path. For example all of the errors regarding
can be resolved after downloading the latest .jar from https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.scr.annotations/1.11.0
Follow these steps to include jar files in your class path. -
These packages need to be within the compiler's class path.
Another way to say it : the compiler needs to be able to know where to find these files. This imposes several constraints: