wood burning stoves*
The moose likes Java in General and the fly likes Including jar files during execution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Including jar files during execution" Watch "Including jar files during execution" New topic
Author

Including jar files during execution

Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
I have incorporated some stuff for the Apache FO processor in my application. To build my application I include the jar files necessary for the apache stuff, and it builds fine. But during execution when I get to the point that calls the Apache stuff my application just hangs, I assume because it can't find it. I don't get any errors or exceptions. I know the jar files are in my classpath, and just to be sure I have explicity added each one to the classpath on the command line. What could be going on here?
One other note. I am using NetBeans as my IDE, and I can build and execute my application with no problem from netbeans. But outside of the IDE is where I run into these difficulties. Any help would be appreciated.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

Has to be something else. If the JVM couldn't find a .class file you would have received a "java.lang.NoClassDefFoundError".


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
If it turns out that I am getting an NoClassDefFoundError, why would it not be able to find the class at runtime? What am I doing wrong here?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

The java virtual machine searches a bunch of directories and archive files called the classpath to find all the classes it needs. If it does not find a class it needs, it throws the java.lang.NoClassDefFoundError. The JavaRanch FAQ has a good section on How To Set The Classpath. If your program is not throwing the above error your classpath should be good.
 
Don't get me started about those stupid light bulbs.
 
subject: Including jar files during execution
 
Similar Threads
connecting to mysql, with java, on a mac
NetBeans configuration issue
Loading drivers
database connectivity
Adding an external jar file library in Netbeans 6.5.1 IDE