Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javac -classpath option - an answer  RSS feed

 
Bryan Noll
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran into this small problem and had to figure it out because of an example in the tutorial from "Head First EJB" - pg. 57. 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 AdviceClient.java

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

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


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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!