File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes JAR utility Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "JAR utility" Watch "JAR utility" New topic

JAR utility

Ahji Thameur

Joined: Jan 31, 2008
Posts: 3
Hi guys,

This my sound stupid, but I'm having problems compressing my project.

This is the structure of my project:
package suncertify.client
package suncertify.db
package suncertify.server

The problem is that I have to put into my jar file this directory structure:
otherwise the code doesn't work.

I have tryed everything: using a manifest file, using -C and -e options of the jar command, creating a jar within another jar.
Even when I write in my manifest:

Class-Path: src
Main-class: suncertify.client.RunApp

I still get : Exception in thread "main" NoClassDefFoundError : suncertify/client/RunApp

If any of you have had this exact problem, please help, I have spent about 15 hours on the command line trying to solve this.
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387

Is the RunApp really in your jar file?
Can you post the package declaration in RunApp?

Ahji Thameur

Joined: Jan 31, 2008
Posts: 3
yes, RunApp is definelty in my suncertify.client package
This is the package statement
package suncertify.client;

I'm using netbeans. Not even the jar created by this ide doesn't work.

This package structure is a must in my assignment.
If I don't have all the packages in a src folder, there's no way I can get the application to work.

I really don't know how to solve this.
I agree. Here's the link:
subject: JAR utility
It's not a secret anymore!