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

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?
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic