bb wrote On 01/10/06 18:00,:
> I have a class file with a main method in the following directory:
> C:\tea\emat\web\WEB-INF\classes\emat\com\edi
[quoted text clipped - 11 lines]
>
> file that exists in the same directory)
The crucial piece of information you've omitted is
the name of the class whose main() method you're trying
to run. Yes, I know you said "Edi210Parser" -- but
that's only the least-significant piece of the name:
you've not divulged the package portion.
I'm going to guess that Edi210Parser.java begins
with "package com.edi;" so that the full name of the
class is "com.edi.Edi210Parser" (make adjustments as
necessary for whatever the actual package name is).
Point #1, then, is that com.edi.Edi210Parser is the
name you must supply on the java command line; Java is
not a mind-reader, able to pluck the package name out
of thin air.
Once you've done that much, Java will look for the
class by starting where the classpath ends (roughly
speaking) and looking for com\edi\Edi210Parser.class.
See the correspondence between the package name and the
directory structure? Good. So your classpath should
be set to c:\tea\emat\web\WEB-INF\classes\emat, because
that's where you want the search for com\... to begin.
Finally, setting the classpath and specifying the
full class name doesn't change your current directory
in any way. If you want "out.txt" to be found in some
directory, you need to cd to that directory before you
start Java. Putting it all together:
cd directory-where-out.txt-lives
java -classpath c:\tea\emat\web\WEB-INF\classes\emat
com.edi.Edi210Parser out.txt
(The final two lines are really just one, wrapped for
legibility.)
Adjust as needed for your actual structure -- for
example, if the package is emat.com.edi, you'd set the
classpath one level higher and prepend "emat." to the
package name on the command line.

Signature
Eric.Sosman@sun.com
> I have a class file with a main method in the following directory:
> C:\tea\emat\web\WEB-INF\classes\emat\com\edi
[quoted text clipped - 28 lines]
>
> Any help would be appreciated....
If your main class is in package com.edi then you need to be in the
directory above this, so
C:\tea\emat\web\WEB-INF\classes\emat\
then run
java -classpath . com.edi.EdiParser210 out.txt
Though the -classpath is probably un-needed. If your package is
different then adjust accordingly.
James