This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes beginners guide to using SAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "beginners guide to using SAX" Watch "beginners guide to using SAX" New topic
Author

beginners guide to using SAX

lupercal hill
Greenhorn

Joined: Sep 28, 2005
Posts: 9
Im running the following code. using jdk1.5.0_04. Do i need to add anything to use sax. I think i might need a package but i dont know.
I get a no class def found error.

The tutorial Im using is here, the code is below

http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/TOC.html

lupercal hill
Greenhorn

Joined: Sep 28, 2005
Posts: 9
I dont need to do anything to import SAX. The problems I had were due to me using argv instead of args.

public static void main(String argv[])

public static void main(String args[])
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14950
    
  26

If your code looks exactly like the above, the problem was not in the fact that you used the name "argv" instead of "args". It's just a variable name, it does not cause a ClassNotFoundException.

You probably hadn't your classpath set up correctly.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14950
    
  26

Originally posted by Jesper de Jong:
If your code looks exactly like the above, the problem was not in the fact that you used the name "argv" instead of "args". It's just a variable name, it does not cause a NoClassDefFoundError.

You probably hadn't your classpath set up correctly.
Saket Barve
Ranch Hand

Joined: Dec 19, 2002
Posts: 229
Lupercal Hill,

I'm not really sure what you mean by this:


I dont need to do anything to import SAX. The problems I had were due to me using argv instead of args.

public static void main(String argv[])

public static void main(String args[])


I feel the name in the parameter should not matter, as long as you use the same name inside your method body. Of course you wouldn't want to use any of the keywords here.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: beginners guide to using SAX
 
jQuery in Action, 3rd edition