• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Executable Jar problem

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
What's a year in metric? Do you know this metric stuff tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic