• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Including jar files during execution

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has to be something else. If the JVM couldn't find a .class file you would have received a "java.lang.NoClassDefFoundError".
 
Shane Roylance
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic