• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Problems deploying my App

 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've written a small Java application in Eclipse, but I'm now having problems deploying the application.
In this case, I'm turning my application into an executable JAR file and that part works just fine. However, this application is using a handful of classes that are stored in a 3rd party JAR file. I had referenced that file from within Eclipse in hopes that Eclipse would take care of setting the path for me, but no such luck.
As it stands now, my executable JAR file works fine until I hit the button that executes the code stored in the other JAR file. At that point, I get a NoClassDefFoundError.
Packaged in my executable JAR file, I have my .classpath file, which looks like this:

The "lib" entry does correctly identify the location of the third-party JAR file, but my application still seems unable to locate that JAR file to load the classes stored there.
Any ideas, anyone?
Edit: I suppose I should point out that my application runs just fine within Eclipse.
Thanks,
Corey
[ March 25, 2004: Message edited by: Corey McGlone ]
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That .classpath file is an artifact of Eclipse I think. So "java" has nothing to do with it (it's just an extra, ignored, file in your JAR).
The standard is to write a "manifest" (manifest.mf) file which specifies the classpath.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup - that was it. I guess that's what you get for using an IDE too much - you start to rely on it to do the right thing for you without understanding what it is you need to do in the first place.
Thanks.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps you've already considered this, but you might do well to include this third party JAR within your JAR. That way your clients won't have to locate and install it separately, and they won't be bothered with knowing its location or dealing with any settings that specify its location.
 
Billybob Marshall
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dirk Schreckmann:
Perhaps you've already considered this, but you might do well to include this third party JAR within your JAR. That way your clients won't have to locate and install it separately, and they won't be bothered with knowing its location or dealing with any settings that specify its location.


Other than the fact that a JAR within a JAR won't work that is. A JAR within an EAR or WAR is ok, but not what you suggested.
 
There's a way to do it better - find it. -Edison. A better tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic