?
Solved

library files

Posted on 2002-05-15
9
Medium Priority
?
166 Views
Last Modified: 2013-11-23
I'm trying to determine exactly which jar files I need for my program.
In my code I have import statements calling:

import javax.xml.parsers.*;
import org.w3c.dom.*;
import javax.servlet.http.*;

However, when building my code, and specifying the exact
classpath to my jar files, I find that I don't need the
jar files for javax.xml.parsers and org.w3c.dom.
Are these included automatically with the jdk somewhere
because why is my build not complaining that they are missing?

It complains if I don't have the javax.servlet.http class files but not the other two. Anyone?
0
Comment
Question by:sorty
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 36

Expert Comment

by:girionis
ID: 7011469
 Are you using any classes of the javax.xml.parsers and the org.w3d.dom packages? Because if you do not then there is no need for it to use them (and thus no complaints). If you are using any Servlet-related classes and the VM cannot find them then it will complain.

  Hope it helps.
0
 

Author Comment

by:sorty
ID: 7011518
I AM using classes of the javax.xml.parsers and org.w3d.dom
packages. Where can it be getting these files from if I'm not providing it.
When I compile using the -classpath option, it should only read from this path right? so even if I have the files in another path it shouldn't read it as long as I don't have them in my classpath environment variable.
0
 
LVL 7

Accepted Solution

by:
yoren earned 400 total points
ID: 7011536
The JDK 1.4 includes JAXP, SAX, and DOM, and therefore the packages you mention. If you try to run or compile on a previous JDK, you'll need to include a JAXP- and DOM-compatible XML parser. Many parsers include those packages within their own JAR. Others include them within a separate JAR.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 

Author Comment

by:sorty
ID: 7011568
Hi Yoren,

thanks, I am using jdk1.4 and therefore that must be where
it is picking it up from.
Do you know where it resides in the jdk1.4 and what form it takes? eg if it is a jar file.
The reason I'm asking is that I tried looking for it.
I only have the jdk1.4\bin in my classpath and this only contains all the exe files.
How does it know where to find it?
0
 
LVL 36

Expert Comment

by:girionis
ID: 7011572
>When I compile using the -classpath option, it should only
>read from this path right? so even if I have
>the files in another path it shouldn't read it as long as I
>don't have them in my classpath environment
>variable.

  Yes this is right. It will read from your classpath only your user-made classes or third-party APIs (the core Java classes are read by the VM even if the classpath does not point at them). So yes it will not read your other two files if your classpath is not pointing at them.

  But let me get your problem right. You are using the DOM classes even if you are not importing them and you are not putting the JAR file in the classpath? If yes then this is really weird.

  I think the latest version of JDK includes support for these classes but you would still have to import them in order to use them. Are you sure that your classloader doe snot look somewhere else first? Are your jar files under the /ext folder? If not then they will be presumed as part of the JDK or to have themselves been installed as extensions.
0
 
LVL 7

Expert Comment

by:yoren
ID: 7011628
The classes are in jre/lib/rt.jar, which has all of the basic Java classes and is automatically included. The included parser is Crimson, which you can get separately from http://xml.apache.org/crimson .
0
 

Author Comment

by:sorty
ID: 7011677
girionis,
Its perhaps not so weird! I am NOT putting the path into my -classpath option (I don't even have the jar files), but I AM putting the import statement into my code.
Therefore, the problem was only where the compiler was reading the files if I didn't have them.

The answer is as voren said which is that they are automatically included into the jdk1.4.

0
 
LVL 36

Expert Comment

by:girionis
ID: 7013147
 Yes, then this is the answer. They are bundled together with the  rest of the JDK1.4 classes. I thought you were using them without imporitng them.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7754152
Question abandoned; force-accepted.

Netminder
EE Admin
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question