I am trying some sample code.
the import statements I see at the top of code - are those similar to the "include" statements for header files?
Should I be able to find a file corresponding to a name in the importstatement?
I am getting an error on one of my import statements stating the file does not exist.
Yes, they are similar.
You are importing the Scanner class, which is found in package java.util.
A list of what packages come with Java's API can be found here: Java 2 Platform SE v1.4.2
The import statement that is "failing" is:
where should this file be located?
If you look at the link, you can browse through all packages and classes provided by Sun, the original API. Users can also create or download their own packages and classes for personal use.
Looking through the packages, Java does not come with org.jdom, which leads me to believe that it is something you need to find on your own before you can import it.
I have found it at a website and downloaded a *.zip file.
I am using NetBeans - I have tried (within NetBeans) to go: tools - JAVA Platform - JAVADOC - add zip file.
No luck with that attempt.
I do see the file burried several directories down within the zip file.
You need to add the file(s) to your classpath. This is a Netbeans problem, search the help feature. I'm not sure if netbeans can handle zip files so you may need to unzip it first.
Originally Posted by Sparky
Under the build directory you'll find the jdom.jar. You want to add that to your build libraries. You'll also want to add the jars under the lib directory to your runtime libraries. They're the ones JDOM uses.