| View previous topic :: View next topic |
| Author |
Message |
Joan Guest
|
Posted: Tue Jan 27, 2004 4:34 pm Post subject: problem running an application from command line |
|
|
I have a .java file created using JCreator LE. I am able to compile
and run it from JCreator LE. But When I tried to do the same thing
from command line, I am able to compile it but got
"java.lang.NoClassDefFoundError" when I tried to run it (and it seems
that it doesn't matter which directory I am in).
Any idea why this is happening?
Thanks for your help.
Joan
|
|
| Back to top |
|
 |
Chris Smith Guest
|
Posted: Tue Jan 27, 2004 4:40 pm Post subject: Re: problem running an application from command line |
|
|
Joan wrote:
| Quote: | I have a .java file created using JCreator LE. I am able to compile
and run it from JCreator LE. But When I tried to do the same thing
from command line, I am able to compile it but got
"java.lang.NoClassDefFoundError" when I tried to run it (and it seems
that it doesn't matter which directory I am in).
Any idea why this is happening?
|
Where are your source files? What are your relevant environment
variables? What directory are you compiling from? (I know you said
you've tried several, but pick one that you think should work.) Where
is the J2SDK installed, and what version is it?
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
|
|
| Back to top |
|
 |
Mark Haase Guest
|
Posted: Tue Jan 27, 2004 10:31 pm Post subject: Re: problem running an application from command line |
|
|
In article <39d54693.0401270834.242dd111 (AT) posting (DOT) google.com>,
[email]joan48105 (AT) yahoo (DOT) com[/email] (Joan) wrote:
| Quote: | I have a .java file created using JCreator LE. I am able to compile
and run it from JCreator LE. But When I tried to do the same thing
from command line, I am able to compile it but got
"java.lang.NoClassDefFoundError" when I tried to run it (and it seems
that it doesn't matter which directory I am in).
Any idea why this is happening?
|
You really ought to paste the full error, and provide more details.
But the most common cause for newbies getting this error is they do the
following:
| Quote: | javac MyClass.java
java MyClass.class
|
When you invoke the java command, it knows to append ".class" when
looking for the class file.
Corrected:
--
| Quote: | /| /| |2 |
mehaase(at)sas(dot)upenn(dot)edu |
|
|
| Back to top |
|
 |
Andrew Thompson Guest
|
|
| Back to top |
|
 |
Andrew Thompson Guest
|
|
| Back to top |
|
 |
Joan Guest
|
Posted: Wed Jan 28, 2004 3:55 pm Post subject: Re: problem running an application from command line |
|
|
Chris Smith <cdsmith (AT) twu (DOT) net> wrote
| Quote: | Joan wrote:
I have a .java file created using JCreator LE. I am able to compile
and run it from JCreator LE. But When I tried to do the same thing
from command line, I am able to compile it but got
"java.lang.NoClassDefFoundError" when I tried to run it (and it seems
that it doesn't matter which directory I am in).
Any idea why this is happening?
Where are your source files? What are your relevant environment
variables? What directory are you compiling from? (I know you said
you've tried several, but pick one that you think should work.) Where
is the J2SDK installed, and what version is it?
|
Thanks guys. Sorry I couldn't reply sooner. I waited the whole day
yesterday for my question to be posted. It must be some glitch within
Google.
I later on figured out that it is because I had a
"package myproject.myclassname" in the source file. That confused the
interpreter.
|
|
| Back to top |
|
 |
|