The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Using -classpath in different shells (for the AdviceApp client) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Using -classpath in different shells (for the AdviceApp client)" Watch "Using -classpath in different shells (for the AdviceApp client)" New topic

Using -classpath in different shells (for the AdviceApp client)

Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
OK, not just for the client, for everything!
In our client application in the book, we are using a csh unix shell (actually tsch, a variant under OSX), which has a particular syntax for environment variables that is not the same for other shells. Some folks are having trouble mapping that syntax to what their own system uses, so I thought we should compile a list here.
1) csh / tcsh:
java -cp {$CLASSPATH}:AdviceAppClient.jar AdviceClient
// note the curly braces, "$" sign, and ":" colon separators

2) On Windows (From Mikalai Zaikin)
java -cp %CLASSPATH%;AdviceAppClient.jar AdviceClient
// note the "%" sign around CLASSPATH, and ";" semicolon separator

3) On Red Hat Linux 9.0 default shell (from Unnsse Kahn)
javac -classpath $CLASSPATH:AdviceAppClient.jar AdviceClient.java
// note that that there are NO curly braces, just the $ sign and the ":" colon separator

So, if you have a shell that uses different syntax, PLEASE post it here and we'll make this part of a reference document.
Cheers and thanks!
Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
thanks a lot for the information.
It is sorta covered in the JavaRanch Style Guide.
subject: Using -classpath in different shells (for the AdviceApp client)
Similar Threads
help on a ejb client problem
Head First AdviceBean is trying to drive me mad
ClassCastException in client
Found solution to AdviceClient...Ha Ha