简体   繁体   English

Eclipse中的UIMA示例无法正常工作

[英]UIMA Example in Eclipse not working

I'm new to Eclipse and UIMA. 我是Eclipse和UIMA的新手。 I'm trying to run UIMA examples, in Eclipse Luna -j2ee platform. 我正在尝试在Eclipse Luna -j2ee平台上运行UIMA示例。 I can run cvd.sh from terminal in examples. 我可以在示例中从终端运行cvd.sh.

When I try to run examples from "Run Configurations", I encounter error as below : 当我尝试从“运行配置”运行示例时,我遇到如下错误:

Error: Could not find or load main class org.apache.uima.tools.cvd.CVD
<terminated>UIMA CAS Visual Debugger [Java Application] 
<terminated, exit value: 1>/usr/lib/jvm/java-7-openjdk-i386/bin/java (22-May-2015 5:52:13 am)   

I tried to run from Run Configurations, and I see similar error for other examples also, like - 我试图从运行配置运行,我也看到其他示例的类似错误,如 -

Error: Could not find or load main class org.apache.uima.tools.AnnotationViewerMain

<terminated>UIMA Annotation Viewer [Java Application]   
<terminated, exit value: 1>/usr/lib/jvm/java-7-openjdk-i386/bin/java (22-May-2015 6:33:43 am)   

What could be the problem? 可能是什么问题呢?

I feel it could be some path related issue, as examples (at least some of them) in terminal apache-uima/bin are working... 我觉得它可能是一些路径相关的问题,因为终端apache-uima / bin中的示例(至少其中一些)正在工作......

I'm using debian , if that helps. 我正在使用debian ,如果这有帮助的话。

My guess is that you have forgotten to set up the UIMA_HOME in Eclipse. 我的猜测是你忘了在Eclipse中设置UIMA_HOME。 This is from the documentation of UIMA 2.7.0 - Setting up Eclipse to view Example Code : 这来自UIMA 2.7.0的文档- 设置Eclipse以查看示例代码

  • In Eclipse, if the Java perspective is not already open, switch to it by going to Window → Open Perspective → Java. 在Eclipse中,如果Java透视图尚未打开,请转到Window→Open Perspective→Java切换到它。
  • Set up a class path variable named UIMA_HOME, whose value is the directory where you installed the UIMA SDK. 设置名为UIMA_HOME的类路径变量,其值是安装UIMA SDK的目录。 This is done as follows: 这样做如下:
  • Go to Window → Preferences → Java → Build Path → Classpath Variables. 转到窗口→首选项→Java→构建路径→类路径变量。
  • Click “New” 点击“新建”
  • Enter UIMA_HOME (all capitals, exactly as written) in the “Name” field. 在“名称”字段中输入UIMA_HOME(所有大写,与写入完全相同)。
  • Enter your installation directory (eg C:/Program Files/apache-uima) in the “Path” field 在“路径”字段中输入您的安装目录(例如C:/ Program Files / apache-uima)
  • Click “OK” in the “New Variable Entry” dialog 单击“新建变量条目”对话框中的“确定”
  • Click “OK” in the “Preferences” dialog 单击“首选项”对话框中的“确定”
  • If it asks you if you want to do a full build, click “Yes” 如果它询问您是否要进行完整构建,请单击“是”

Disclosure: I am on the Apache UIMA project 披露:我在Apache UIMA项目上

Creating a UIMA user library in Eclipse 在Eclipse中创建UIMA用户库

  • Go to Window → Preferences → Java → Build Path → User Libraries 转到窗口→首选项→Java→构建路径→用户库
  • Click "New" 点击“新建”
  • Enter a name your user library (I used "UIMA"), Click "OK" 输入用户库的名称(我用“UIMA”),点击“确定”
  • Select your new user library, Click "Add External Jars..." 选择新用户库,单击“添加外部JAR ...”
  • Go to your UIMA_HOME/lib directory and select all JARs, Click "Open" 转到UIMA_HOME / lib目录并选择所有JAR,单击“打开”
  • Verify your user library has all the UIMA lib JARs in it, Click "OK" 验证您的用户库中是否包含所有UIMA lib JAR,单击“确定”

Now make sure the UIMA user library is in the run configuration classpath and you should be able to start a UIMA example from Eclipse. 现在确保UIMA用户库在运行配置类路径中,您应该能够从Eclipse启动UIMA示例。

Seems you've missed this part of installation: 3.3 http://uima.apache.org/d/uimaj-2.7.0/overview_and_setup.html#ugr.ovv.eclipse_setup.adding_source 好像你错过了这部分安装:3.3 http://uima.apache.org/d/uimaj-2.7.0/overview_and_setup.html#ugr.ovv.eclipse_setup.adding_source

After that, I've fixed it by adding the all UIMA jars into classpath. 之后,我通过将所有UIMA jar添加到classpath中来修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM