[NEWBIE] Running an application in a package [message #213647] |
Mon, 04 June 2007 10:35 |
Eclipse User |
|
|
|
Originally posted by: ciccio4242.libero.it
Hi,
with eclipse I have written some classes included in a package name
org.myname.myclasses. Inside this package there is also a Test class
which has the main in order to test the classes themselves.
Inside eclipse everything is fine, but when trying to run it from
command line I'm lost: relative to c:\workspace I have myproject
directory, and inside I have bin. Inside bin there is
org\myname\myclasses where my .class are located, included Test.class.
If I go the the top of the whole, i.e. from bin directory and I type
java org.myname.myclasses.Test
I have the following error:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/myname/myclasses/Test
What am I doing wrong?
Thanks
|
|
|
Re: [NEWBIE] Running an application in a package [message #213663 is a reply to message #213647] |
Mon, 04 June 2007 13:12 |
Eclipse User |
|
|
|
Originally posted by: ciccio4242.libero.it
ciccio wrote:
> with eclipse I have written some classes included in a package name
[...]
> java org.myname.myclasses.Test
[...]
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/myname/myclasses/Test
> What am I doing wrong?
Auto-Answer: I forgot the -classpath clause, i.e.:
java -classpath c:\workspace\myproject\bin org.myname.myclasses.Test
Ciao
|
|
|
Powered by
FUDForum. Page generated in 0.09026 seconds