1

I've an ontology file and i'm working with OWL-API. I should retrieve for my class (#Doc) her individuals and theirs Object Properties
actually i tried two ways to get the individuals, but i get always this error :

Exception in thread "main" java.lang.NoClassDefFoundError: javax/inject/Provider

(i think it mean that the compiler can not find my class !)

ridoibm75
  • 27
  • 2
  • 10
  • any help please ! – ridoibm75 Apr 12 '17 at 11:24
  • This looks like you're missing some dependency, because what is not found is `javax.inject.Provider`. It'll be good if you share your Maven POM (`pom.xml`) file, too. – Emre Sevinç Apr 12 '17 at 11:31
  • Can you please provide a full stacktrace? – MojoJojo Apr 12 '17 at 11:32
  • Also please see the following StackOverflow questions: http://stackoverflow.com/questions/40822568/noclassdeffounderror-javax-inject-provider-and-classnotfoundexception-javax-in and http://stackoverflow.com/questions/30459428/getting-error-in-executing-owl-api – Emre Sevinç Apr 12 '17 at 11:32
  • @EmreSevinç i do not have a clear idea about Maven, but i think that there is two way to use OWL api , i'm not working with '' Maven dependency '' but i'm using the jar file of owl-api in my project with Netbeans – ridoibm75 Apr 12 '17 at 11:38
  • @MojoJojo sorry but i do not know how to get it & i thought also that my problem is linked with parameters ! – ridoibm75 Apr 12 '17 at 11:58
  • can you upload your code to github? – MojoJojo Apr 12 '17 at 12:11

1 Answers1

-1

I suggest you either learn a bit of Maven (it'll be very helpful for your future Java projects), and add the following to your pom.xml:

<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-distribution</artifactId>
    <version>5.1.0</version>
</dependency>

Or, put all of the JAR files in the application classpath. (After all, this is what the official documentation suggests).

But I highly advise that you with the first option, that is, learning just a bit of Maven. You'll spend less than a day, but in the end it'll save you a lot of trouble.

Emre Sevinç
  • 8,211
  • 14
  • 64
  • 105
  • If you found my explanations useful, can you please `accept` what I write above as an answer, so that this question is resolved? – Emre Sevinç Apr 12 '17 at 12:46
  • but when i will finish this step i fear that maybe i'll ask again another question linked with Object properties 'as i said in my main question' if it does not matter i'll accept – ridoibm75 Apr 12 '17 at 12:55
  • 1
    According to StackOverflow best practices and guidelines, it is better to ask this as a separate question because the question you asked above is more about Java and Java project building and configuration in general; not directly related to OWL and semantic web in particular. – Emre Sevinç Apr 12 '17 at 13:00
  • 1
    I should change the wording of the official documentation. A dependency management system - be it Maven or anything else - is always the best option. – Ignazio Apr 23 '17 at 10:23