Running java programs from class files



Hello,

I have created two class: ClassOne & ClassTwo (with main) in MyClass
package. When I run it in eclipse everything goes okay. When I create
jar and choose ClassTwo as Main everything goes okay.
But now I am interested in running it just from class files. What is a
correct syntax for such example?!?
I tried:
"java -classpath . ClassTwo" and similar but never run it getting all
the time: NoClassDefFoundError.

Regards, mark

.



Relevant Pages

  • Re: Running java programs from class files
    ... ClassOne & ClassTwo in MyClass ... When I run it in eclipse everything goes okay. ... package names, tokenised along dots, e.g. java.lang.String would be in ... Whichever directory has the java directory (in ...
    (comp.lang.java.programmer)
  • Re: Running java programs from class files
    ... ClassOne & ClassTwo in MyClass ... When I run it in eclipse everything goes okay. ... package names, tokenised along dots, e.g. java.lang.String would be in ...
    (comp.lang.java.programmer)
  • Re: Access Data Inside JAR
    ... root of the containing JAR file. ... Okay, well, that makes sense. ... doesn't this work within Eclipse? ... If I use the System classloader, ...
    (comp.lang.java.programmer)