Command line execution [message #62156] |
Mon, 09 May 2005 17:29 |
Eclipse User |
|
|
|
Originally posted by: timothy.williams.comverse.com
I've built a java program within the IDE. Everything works fine.
Now I want to run the program from the command line so I can
put the program into a script.
From within the directory that my main class resids I run,
java -cp <my libs> main.test
Result:
Exception in thread "main" java.lang.NoClassDefFoundError: test_main
Anyone know what I'm doing wrong so this can run?
thanks
Tim
|
|
|
Re: Command line execution [message #63276 is a reply to message #62156] |
Thu, 12 May 2005 06:57 |
Eclipse User |
|
|
|
Originally posted by: aronbock.hotmail.com
Tim,
This is one of the pitfalls of using an IDE--it handles so much of the
setting-up for us that we're often lost without it. In your commandline
example:
java -cp <my libs> main.test
you're implying that you're trying to run a public static void main() method
in a class called test, which is itself in a package called main. If that
isn't your package/class layout, you may want to refer a link such as
http://www.cs.cornell.edu/courses/cs211/2003fa/Sections/Comm on/S1/applications.html
Regards,
--A
"Tim Williams" <timothy.williams@comverse.com> wrote in message
news:658c45cc434983dc48efe662a4e273c4$1@www.eclipse.org...
> I've built a java program within the IDE. Everything works fine.
>
> Now I want to run the program from the command line so I can
> put the program into a script.
>
> From within the directory that my main class resids I run,
>
> java -cp <my libs> main.test
>
> Result:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: test_main
>
> Anyone know what I'm doing wrong so this can run?
>
> thanks
>
> Tim
>
|
|
|
Powered by
FUDForum. Page generated in 0.27515 seconds