Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » [NEWBIE] Running an application in a package
[NEWBIE] Running an application in a package [message #213647] Mon, 04 June 2007 10:35 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Syntax coloring
Next Topic:I can not find the menu
Goto Forum:
  


Current Time: Tue Sep 24 04:30:40 GMT 2024

Powered by FUDForum. Page generated in 0.09026 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top