Java .jar - NoClassDefFound problems

Associate
Joined
22 Jul 2004
Posts
230
Location
Nottingham, UK
I've done a Java project using netbeans using the JDK1.5.
It builds and creates a jar file which runs fine on my pc.

However when I move it to the uni computers it doesn't work:
(The uni computers hav JDK1.4 installed with netbeans 5.0RC2, but they also have JRE1.5)
I get the following error

>java -jar CarHire.jar
------ Starting Client Mode ------
Exception in thread "main" java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group
at CarHire.Main.main(Main.java:29)

It creates the following in the dist directory

/dist/CarHire.jar
/dist/lib/swing-layout-1.0.jar
/dist/lib/AbsoluteLayout.jar

The jar runs fine on my pc.

Does anyone know how to get it to run?
 
Rossmac said:
ask the uni to update to 1.5? I think GroupLayout changed a bit going from 1.4 to 1.5
They can't/won't. Due to the amount of red tape just to get anything installed.

SoapSurgeon said:
Have you set up your classpath correctly on the uni machines?
What is the correct class path to use?
 
I've played around with the classpath but still can't get it to run:

the Manifest file inside the jar contains the following:
Code:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.6.0-b105 (Sun Microsystems Inc.)
Main-Class: CarHire.Main
X-COMMENT: Main-Class will be added automatically by build
Class-Path: lib/swing-layout-1.0.jar
 
line 29 is basically
frm = new frmMain();

frmMain() errors out at the layout code for the form.
I'm sure its just not finding the GroupLayout class.
 
Back
Top Bottom