Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executable Jar problem

 
Jhakda Velu
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I was trying to make a small application and give to my users as a executable jar file. My application is a single screen developed in swing with the processing logic in a POJO. The main method is the same class as that making the swing screen. When I package the application,though it starts on double click and the swing screen comes up, nothing happens on call of the pojo.I've checked this by putting popups before and after the new call on my pojo, the first one comes up,when the one after the new call doesn;t. However, teh same executes well through Eclipse on any system. In my system,the jar file also works.
I tried mentioning the jars used by my POJO in the manisfest classpath varible also. When i explode the jar created, it does contain all the necessary jar files in its lib folder.
I'm a bit stuck and some fresh idea will be most welcome.
That the JAR works on my system and doesn't on others is troubling me. Also, how come Eclipse is able to run the code?

Thanks

Jhakda
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of double clicking to launch the jar, run it from the command line using the java -jar JarFileName.jar That way you can look at exception stack trace if any.
 
Jhakda Velu
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thanks for the input. I checked it out that way, and found that it is unable to find a jar file referred from the POJO. I tried to put the required jars through the manifest file Classpath variable
Class-Path: jxl.jar log4j-1.2.9.jar
and also
Class-Path: lib/jxl.jar lib/log4j-1.2.9.jar
Both the jars are there when i explode the jar i created (in the lob folder).
Whats going wrong? why is the application unable to find the jars?

Thanks
Jhakda
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jars inside jars are not picked up by the class-path.
Check this out for more details
http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html
 
Jhakda Velu
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Many Thanks!!
I placed the 2 needed jars in the same folder as the jar i create and it works just fine.
Thanks a lot once again.

Jhakda
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic