File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes -cp on linux | how do I include additional jar files? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply Bookmark "-cp on linux | how do I include additional jar files?" Watch "-cp on linux | how do I include additional jar files?" New topic
Author

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

Harold Lime
Ranch Hand

Joined: Jul 20, 2009
Posts: 38
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?
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12950
    
    3

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


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Harold Lime
Ranch Hand

Joined: Jul 20, 2009
Posts: 38
Brilliant! I knew would be simple.

Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14568
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: -cp on linux | how do I include additional jar files?
 
Similar Threads
Trouble with running Maven Tomcat plugin through Eclipse
Jsp failed to execute in Netbeans
Glassfish deployment issues
Struts2 Error
Hibernate configuration issue: connection provider or hibernate.dialect issue