• 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

-cp on linux | how do I include additional jar files?

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've got the following running fine one a Windows machine:

But the following does not work in Linux.

I'm fairly new to Linux so I've probably missed something simple.

Can someone tell me what I'm missing?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On Linux you must use : (colon) instead of ; (semi-colon) to separate entries on a path - because ; has a different meaning in the shell on Linux. So it should be:

java -cp bin:./lib/commons-lang-2.5.jar:./lib/commons-collections-3.2.1.jar sandbox.LegionLauncher
 
Harold Lime
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brilliant! I knew would be simple.

Thanks.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do be careful with those semicolons! In Linux/Unix, you use colons to delimit commands just like Java code does. Windows had to use semicolons because they use colons as part of their file path naming scheme.
 
reply
    Bookmark Topic Watch Topic
  • New Topic