• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems creating a Jar file

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been over my code for days and can't create a Jar file to run it out of the Eclipse IDE.
The Jar file is created successfully, but I keep getting the following error when trying to run the Java Archive:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at edu.pucrs.library.bookRenewal.BookRenewal.<clinit>(BookRenewal.java:17)

My Manifest.MF is exactly as:

Manifest-Version: 1.0
Main-Class: edu.pucrs.library.bookRenewal.BookRenewal
ClassPath: lib/log4j-1.2.8.jar,lib/activation.jar,lib/commons-httpclient.jar,lib/HTTPClient.jar,lib/mail.jar

...and my app structure looks like this:

edu
|- pucrs
|- library
|- bookRenewal

lib
|- log4j-1.2.8.jar

The main method is under the bookRenewal package, as showed in the Manifest.

I'm absolutely out of ideas here, guys. Any insight is much appreciated. Many thanks in advance.
 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Filipe,

- ClassPath: should be Class-Path:
- list of libraries should be space separated

Jar Guide

Sheldon Fernandes
 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I changed the manifest without luck. The new Manifest looks like this:

Manifest-Version: 1.0
Main-Class: edu.pucrs.library.bookRenewal.BookRenewal
Class-Path: lib/log4j-1.2.8.jar lib/activation.jar lib/commons-httpclient.jar lib/HTTPClient.jar lib/mail.jar


...the problem with Log4j persists:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at edu.pucrs.library.bookRenewal.BookRenewal.<clinit>(BookRenewal.java:17)


Any help is still much appreciated.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you trying to use a JAR inside of a JAR? That doesn't work out-of-the box.

It's been rumored that the open source project, One-JAR includes a custom classloader to do such a thing. I haven't tried it, yet. If you do, please let us know how it goes.
reply
    Bookmark Topic Watch Topic
  • New Topic