0

I would like to add this to my imports and use it to verify URI addresses however, I am having trouble figuring out how to properly import this http://www.jdom.org/docs/apidocs/org/jdom2/Verifier.html. Do I have to update my Maven repo? I understand that it is included in java.lang.Object, but when I include that it can't find Verifier.

Can someone please help me understand the problem here?

Ejay

tomato
  • 831
  • 5
  • 15
  • 33
  • *Included* in `java.lang.Object`? Doesn't make sense. A *subclass*? Of course. Have you added the JAR/folder to your classpath, and told javac/java where to find it? – Makoto Aug 31 '12 at 02:17
  • 1
    What do you mean, "included in java.lang.Object"? You need to add the library as a dependency in your pom if you're using Maven. – Dave Newton Aug 31 '12 at 02:18
  • Look at the link: it **inherits** from java.lang.Object. – Nate C-K Aug 31 '12 at 02:20
  • @NateC-K every thing inherits from java.lang.Object ... :P Wouldn't you `import org.jdom2.Verifier` ?? – MadProgrammer Aug 31 '12 at 02:22
  • @MadProgrammer: Yes, it does. But the fact that this class inherits from java.lang.Object is what Ejay was referring to in the question (clearly out of confusion as to what the hierarchy thing in the javadoc represents). – Nate C-K Aug 31 '12 at 02:23
  • Okay, well... from my understanding I can't use this object easily from what you guys are saying. I really just want to use this to verify URI addresses which this class allows me to do. But, I guess in this case, it might be better to create my own implementation of a URI checker. I just don't want to re-invent the wheel. – tomato Aug 31 '12 at 02:24
  • @NateC-K Sorry - Confusion is ramped :P – MadProgrammer Aug 31 '12 at 02:24
  • import org.jdom2.Verifier doesn't do anything for me... – tomato Aug 31 '12 at 02:25
  • @EjayTumacder: Making your own URI verifier will be a lot more work than figuring out how to use a library. You have to figure out how to use libraries anyway. It's not that hard. Reading and implementing this document sure seems harder to me: http://tools.ietf.org/html/rfc3986 – Nate C-K Aug 31 '12 at 02:31

2 Answers2

3

You can get JDOM 2.0.2 from Maven Central Repository:

<dependency>    
    <groupId>org.jdom</groupId>
    <artifactId>jdom</artifactId>    
    <version>2.0.2</version>
</dependency>

Here is a link to Maven Central Search for JDOM 2.0.2

I just pulled down jdom-2.0.2.jar from here and verified that it does contain org.jdom2.Verifier.class

Philip Tenn
  • 6,003
  • 8
  • 48
  • 85
1

The jdom2 project isn't available (yet) through Maven. (You can't just add some XML to your POM.)

You can download the JAR file here:

http://www.jdom.org/downloads/index.html

This SO question discusses how to use a plain JAR file with your Maven project:

Can I add jars to maven 2 build classpath without installing them?

Community
  • 1
  • 1
Nate C-K
  • 5,744
  • 2
  • 29
  • 45