• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAR question  RSS feed

 
Maarten Vergouwen
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I'm trying to get my application into a JAR, but I'm having trouble.
If I run the application from my IDE (NetBeans), it works fine, but if I try to run it as a JAR it gives the following error:
java.lang.NoClassDefFoundError: TempusUI/class
Exception in thread "main"

:-(
I suppose I did something wrong in defining the JAR (since the app works when not using it), but I have no idea what..
Can someone please post an example of how to, step-by-step, create a JAR file for a simple application (consisting of 3 classes all in the same dir, no package, very basic).
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the best link i've ever found.
Making a Jar file
 
Maarten Vergouwen
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice link, but unfortunately it didnt solve the problem
I have found out however that when I try to strat my app from the commandline without using the jar, I get the same error.. :
Exception in thread "main" java.lang.NoClassDefFoundError: TempusUI/class
So it seems to be an issue with the environment, something that works within my IDE but not outside of it. *sigh*
Any ideas?
[ January 31, 2004: Message edited by: Maarten Vergouwen ]
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program I wrote for school. I made a jar file using that link. It should work.
My directory structure looks like this: It's not perfect
C:
>>JavaPrograms
>>>>MovieJava // this is where my manifest file and jar is located
>>>>>>movieJava2 // this is where my java and class files are located
my manifest file contents look like this:
Main-Class: movieJava2.WindowGUIMI
//movieJava2 is the package and WindowGUIMI is the java file which contains the main method (or moment interval, hence the reason I named it "...MI")
By using the link I sent you I am able to double click on the jar file and my program runs.
Does this help?
[ January 31, 2004: Message edited by: leo donahue ]
 
Maarten Vergouwen
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it does
I added ".class" to the main class in my manifest file... EXACTLY LIKE IT SAYS IN THE BOOK I'M USING
What is the world coming to when you cant trust your reference books eh?
Thats another 2 hours of my life I'll never get back
Thanks alot!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leo donahue:
This is the best link i've ever found.
Making a Jar file

I'm a Pisces, but leo is my hero of the hour.
Yes, flattery can go far with me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!