• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Executable Jar's

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created two executable jar's, one for the client and one for the server. These work fine when used in network mode (i.e. launched seperately). However, when I run the client in stand alone mode, I require classes contained within the server jar file, and I get ClassNotFoundException's, so I need to add the server.jar to the classpath.
When I try:

The client launches correctly, but the additional classpath entry is ignored. Is this how one specifies additional classpath entries when using execuatable jars?
Or am I required to created a third jar file that contains all the classes, just so I can run in standalone mode?
Thanks!
--Dave.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Simple. You know how to specify a Main-Class attribute in your jar manifest. Well, you can also specify a Class-Path attribute Have a look at the JAR file specification.
- Peter
 
Dave Teare
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! It works fine now.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic