I have a class in directory c:\Workspace\RegExTest\bin\RegexTestHarness.class
if I go to directory c:\Workspace\RegExTest\bin and then type
java RegexTestharness
the class can be run successfully.
but if I run in another place and try to run like
java c:\Workspace\RegExTest\bin\RegexTestHarness
or
java -cp c:\Workspace\RegExTest\bin\RegexTestHarness
both return error, so what is the correct syntax to run the class without go to its directory first?
Also, if run in eclipse, there is error "No console."
the class is just copy from tutorial as follow: