• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Order of jar and dir classpath items seems to impact runtime

Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a simple code like so, which imports a single class

and I can compile it like so (hopefully the references to a typical Unix maven repository will be familiar enough to everyone)

where I link to the jar. But, when I run it something interesting happens. The following command, with jar followed by local directory dot, runs:

with the output

which is correct. However this same command, with the dir dot and the jar path switched:

throws the following error:

In otherwords, I think java is "giving up" after the dot and not looking for the jar for some reason. Is this expected behavior? Is there a principle here I need to understand?
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic