• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to run pgm. when in jar....  RSS feed

 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using 4 Jframes and correspondigly 4 java classes for them. The program runs fine. But when i package it in jar file while giving the manifest info with the mainclass; the first frames runs ok but when i press submit button what happens is i create the object of another class and this is where the program gets stuck what could be the reason???
The constructor of the class which is called contains the tools to make the 2nd frame. But it does not event enters the constructor.

I am extending JFrame in all the classes and using ContentPane and adding componenets to it. and i am doing all this in the constructor of each class.


Thanks.
Robin
[ June 14, 2008: Message edited by: robin singal ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you mean by "gets stuck"?
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By get stuck i mean :

I am using setTitle() to know exactly where i am in the code...
So after the setTitle() the control goes to the formation of an object which is assigned to the static variable of that class type...
But the control does not go into the constructor of that class whose object is created. Event i have user setTitle in exception there is also no exception raised.
Why the program that runs in console does not run with the jar file??
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to ellaborate the situation... :



Now the Otherclass constructor contains the code to make another frame.
by getting contentPane and setting layout and adding the required components.
But the Jframe does not appear but it does when i run the program in console??///

Thanks
[ June 16, 2008: Message edited by: robin singal ]
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I received the error:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: OtherClass..
...
....
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry

It was a silly mistake I forgot to include cureent directory in the manifest file..

Thanks
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!