为什么一些进口不能解决? [英] why some imports cannot be resolved?

查看:135
本文介绍了为什么一些进口不能解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是java的新手,我试图用单词net来进行分析。
当我使用wordnet类时,导入以下失败

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;

所有以上导入都无法像 org.apache.felix org.apache.lucene org.apache.stanbol org.osgi

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

org.apache.felix.scr.annotations.x

。 felix / org.apache.felix.scr.annotations / 1.11.0rel =nofollow> https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.scr.annotations/1.11。 0

can be resolved after downloading the latest .jar from https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.scr.annotations/1.11.0

按照以下步骤将jar文件包含在类路径中。
-

Follow these steps to include jar files in your class path. -


  • 将所需的jar文件从您的下载目录拖到项目的src
    目录中, / li>
  • 右键单击jar文件,选择构建路径,然后选择添加到构建路径选项。

  • 对话框将出现要求您链接jar文件中的所有文件,只需使用默认值即可。

  • 您现在已经完成,所有关于导入的错误都将被解决。 >
  • Drag the required jar file from your download directory to the src directory of your project in eclipse
  • Right click on the jar file, Select Build Path and then select Add To Build Path option.
  • A dialogue box will appear asking you to link all files in the jar file, just stick with the defaults and hit OK.
  • You are done now, all your errors regarding imports will be resolved.

这篇关于为什么一些进口不能解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆