This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "packages" Watch "packages" New topic


Manoj Zachariah
Ranch Hand

Joined: Dec 08, 2003
Posts: 65
this line gives me an error saying that the package does not exist.
how do i get the package and install it
Joe Ess

Joined: Oct 29, 2001
Posts: 8876

You need to understand how the classpath works and how to set it.
As for where that package came from, The Java package naming convention is the inverse of the domain name of the entity that produced it. Your package, therefore, came from IBM. If the example you are looking at is from Websphere so you could start by looking under the webserver directory for some jar file with "xml" in it's filename. You can examine the contents of jar files with "jar -tf <filename>" or Winzip.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I just did a quick search with Google and found a link to download it at I believe this download includes the xml4j.jar file that you were searching for in a previous thread.
You'll want the xml4j.jar file that is inside of the downloaded file. To compile a class that makes use of a class in the JAR file, you'll have to let the compiler know to use the JAR file by specifying its location in the CLASSPATH setting at compiler time. You'll likely have to do a similar thing at runtime.
Take a look at our wiki page on HowToSetTheClasspath for the steps involved on doing just such a thing.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
subject: packages