This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help with java -classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with java -classpath" Watch "Help with java -classpath" New topic

Help with java -classpath

Matthew Snow
Ranch Hand

Joined: May 02, 2007
Posts: 82
I made a simple Hello World program that uses log4j just so I would have to define a class path. I'm running java 1.6.0_14 in linux and when I run the following command I get the Usage ending with -bash: bin/.: is a directory

java -cp lib/log4j.jar;bin/. testing.Test

If I take out the logging an just have System.out and remove the log4j, it runs just fine. man java says that the class path is supposed to be a ; separated list of directories. How do I do this.

When you break the big rules, you get a lot of little rules.
Matthew Snow
Ranch Hand

Joined: May 02, 2007
Posts: 82
Well, maybe because when running cygwin in side a Windows environment, the java man says ; separated. In a linux environment it says : separated.
I agree. Here's the link:
subject: Help with java -classpath
It's not a secret anymore!