This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

-classpath list  RSS feed

 
V Bose
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you specify a list of classpath(s) when invoking the command line javac compiler, with a -classpath switch, in a Windows environment ?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Separate each entry with semicolons, like this:
-classpath c:\foo;d:\bar;c:\jars\my.jar;.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For any Linux-using Java greenhorn lurkers out there, note that different locations in the classpath setting are separated with a colon - not with a semicolon as is used on Windows.
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is pretty agnostic when it comes to path separators, so you can use either type of slash when specifying a path. Thus you could use:
-classpath c:/foo;d:/bar;c:/jars/my.jar;.
on Windows and it would work just as well. When using file paths in Java, I find it easier to use:
String props = "C:/MyApp/resources/main.properties";
than
String props = "C:\\MyApp\\resources\\main.properties";
As I switch between UNIX and Windows, I'm always using the same path separator which keeps things consistent.
[ September 11, 2003: Message edited by: Wayne L Johnson ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your post isn't perfectly clear to me.
I'm not a Linux user, I just pretend to give CLASSPATH advice at times.
Someone once told me that the CLASSPATH locations on Linux had to be separated with colons. Is this not the case and we can just use semicolons as with Windows?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!