> I have read the entries about class path and understand that you no longer
> use the environment method to set the path and now you enter the path at the
[quoted text clipped - 6 lines]
> What do I add to that?
> I am running WinXP
Bob,
You can specify the classpath from the java executable using the -cp
switch. For example:
> java -cp somewhere MyProgram
Where somewhere is your classpath (holding classes) and MyProgram is the
java class you want to execute (the one with a static main method).
Where you 'point' your classpath depends on what classes & jars you want
access to.
For example, within a particular projects directory, I create another
called class.
I compile everything like this:
> javac -d class MyProgram.java
This dumps the class files into the class directory. Then to run the
program I use this:
> java -cp class MyProgram
The benefit is that it keeps all the .class files away from your .java
source files. A bit tidier I reckon.
You can also use the -cp switch to include jars
> java -cp class:someJar.jar MyProgram.
Hope that helps, if not, perhaps provide a bit more info on what you are
trying to do.
Andy