This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar file opens the main class but not the other classes....

 
Bhagyashri Dalave
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hieee...
i have created a java application for an enquiry management system...
but when i creates a jar file it opens by double click also but the problem is it only opens the main class menu that i have specified as a main class in manifest.txt but when i clicks on any menu it is not able to load the other classes.... i am calling another class by 'new classname()'....
please help me...
any help would be appreciated...
Thanks in advance...
 
Swastik Dey
Rancher
Posts: 1603
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhagyashri,

What error is it showing? Have you included all the required files while crating the jar.
 
Bhagyashri Dalave
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi swastik....
i am not getting any error...
if i runs the same jar file using command prompt java -jar menu.jar then works but it i runs it by double click it just loads the main class and not the other classes...
Thanks
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I deleted my response - I misunderstood.
 
Vinod Tiwari
Ranch Hand
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to initialize / call other class from the class which you have mentioned in Manifest file.
 
Bhagyashri Dalave
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vinod
Yes i am calling other classes from the main class that i have specified in manifest file...
by using new class()
but the strange thing is when i runs jar by double clicking it... it runs but when i clicks on menu one class opens but not the other classes...
Thanks
 
Bhagyashri Dalave
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you opens reports->followup->periodic followup then it opens...
but if you try to open other classes then it will not open...
i am really stuck here...
not getting what is the problem...
Thanks
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhagyashri,

the most important tool that you have in your toolbox as a Java developer is stack traces. So, make sure that when you catch an exception, you log it. Wither do e.printStackTrace or if you use a logger, use the logger API to log the exception. That should point you in the right direction for 60% of your problems

The next important tool is either debugger or logging messages. When something is not working, you can debug through the code and make it go step by step to check if the code is following the path that you expect. When it doesn't you can inspect your variables to figure out why it doesn't follow the path that you want it to follow. SOme people don;t like debugger and do this by putting log messages all over the code

Just saying "trying to open class" doesn't help anyone. That's like calling your mechanic and telling them, "my car doesn't start"*. It's completely useless. You need to go under the hood

*[complete hijack]
SOmeone I knew who is a damn good programmer herself did this with a mechanic. SHe had a problem with the ignition on her car. She called me for help, and I couldn't figure it out, so I told her to call a mechanic. She calls the mechanic and the first thing she says is "my car doesn't start". I was sitting there shaking my head. The first thing the mechanic said "Do you have gas/petrol?"
[/complete hijack]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic