5

I'm new to Eclipse and UIMA. I'm trying to run UIMA examples, in Eclipse Luna -j2ee platform. I can run cvd.sh from terminal in examples.

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...

I'm using debian, if that helps.

Tharif
  • 13,794
  • 9
  • 55
  • 77

3 Answers3

0

My guess is that you have forgotten to set up the UIMA_HOME in Eclipse. This is from the documentation of UIMA 2.7.0 - Setting up Eclipse to view Example Code:

  • In Eclipse, if the Java perspective is not already open, switch to it by going to Window → Open Perspective → Java.
  • Set up a class path variable named UIMA_HOME, whose value is the directory where you installed the UIMA SDK. This is done as follows:
  • Go to Window → Preferences → Java → Build Path → Classpath Variables.
  • Click “New”
  • Enter UIMA_HOME (all capitals, exactly as written) in the “Name” field.
  • Enter your installation directory (e.g. C:/Program Files/apache-uima) in the “Path” field
  • 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

rec
  • 10,340
  • 3
  • 29
  • 43
  • 1
    Thanks for the answer. But I've actually set-up UIMA_HOME. Both in eclipse, and bash [I'm using debian] – tired and bored dev May 22 '15 at 07:14
  • 1
    my UIMA Path is /home/xxxxxx/libraries/apache-uima and in fact, I could run SofaExampleApplication example, but not other examples.. Any suggestions? or Variable values you need to debug? – tired and bored dev May 22 '15 at 07:37
  • It would have been better without the disclosure. Sorry to say but your solution doesn't work and there is a **huge** gap between the documentation and UIMA in practice. – ksha May 10 '17 at 15:30
  • @ketan If what people report here doesn't work for you, please post to the UIMA users mailing list (https://uima.apache.org/mail-lists.html), tell us about it and help us improve the documentation. – rec May 10 '17 at 21:41
  • @rec I saw this coming but thanks for not sounding rude (when you could have). I'll try to follow what you said. – ksha May 11 '17 at 07:59
0

Creating a UIMA user library in Eclipse

  • Go to Window → Preferences → Java → Build Path → User Libraries
  • Click "New"
  • Enter a name your user library (I used "UIMA"), Click "OK"
  • Select your new user library, Click "Add External Jars..."
  • Go to your UIMA_HOME/lib directory and select all JARs, Click "Open"
  • Verify your user library has all the UIMA lib JARs in it, Click "OK"

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.

LokiPatera
  • 45
  • 1
  • 5
0

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

After that, I've fixed it by adding the all UIMA jars into classpath.

Raymond Reddington
  • 1,709
  • 1
  • 13
  • 21