File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

Joined: Oct 10, 2002
Posts: 1589
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.
I agree. Here's the link:
subject: From "Head First EJB" - pg. 57
jQuery in Action, 3rd edition