This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes From 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 » Java » EJB and other Java EE Technologies
Bookmark "From "Head First EJB" - pg. 57" Watch "From "Head First EJB" - pg. 57" New topic

From "Head First EJB" - pg. 57

Bryan Noll

Joined: Feb 06, 2004
Posts: 26
Don't go through the same pain I went through figuring out the command-line nuances here.

What the book says the command should be...
javac -classpath {$CLASSPATH}:AdviceAppClient.jar

What works from cygwin...
javac -classpath "$CLASSPATH;AdviceAppClient.jar"

What works from dos...
javac -classpath "%CLASSPATH%;AdviceAppClient.jar"

It took me a couple painstaking hours to figure this out...not a big deal....but in case you have to do it. Appending to the system classpath for only that compile. Assumption is that the .java file you're compiling needs access to some classes that don't exist in the system classpath, but those classes are not permanent enough for you to want to add to the system classpath.
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Thanks Bryan! We really meant to have something in the intro to the book that discussed the subtle (and not subtle) differences in command-line syntax, etc. But we didn't... I *wimped out* and just said, "Here's the way it works in one shell... you'll need to adjust it for the syntax of your own shell..."

And we didn't do the best job at explaining why we're doing it. We'll try to improve that in the next version, or maybe put something on our website.

Anyway, thanks again for taking the time to post this so that others won't have to struggle.

Bryan Noll

Joined: Feb 06, 2004
Posts: 26
No and Bert do enough good work in those books that you shouldn't have to worry about stuff like that. Little dinky problems like that provide the anally stubborn portion of me satisfaction when I'm able to make it go.
jQuery in Action, 2nd edition
subject: From "Head First EJB" - pg. 57
Similar Threads
AdviceClient Solution
ClassCastException in client
Chapter 1 - Advice Client
help on compile ejb client
javac -classpath option - an answer