1) Create a classes directory where your classes will go. Then, place that
directory in your classpath
2) Create a jar and place it in your classpath

#1 is easier during initial development.


-----Original Message-----
From: meiyi leong [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:25 AM
To: [EMAIL PROTECTED]
Subject: Re: problem with jdk1.3


hi there,

IT doesn't make sense that every time i create a new class, i've to include
it in
the class path?
How should i tackle this problem?

In the command prompt, i typed
c:\>javac HelloWorld.java
followed by
c:\>java HelloWorld

when i typed java HelloWorld, the error message appear.

Luis Javier Beltran wrote:

> > The thing is. all the classes are in *.jar files
> > and there isn't any class files except for the examples.
>
> But error java.lang.NoClassDefFoundError: HelloWorld
> tells that class HelloWorld was not found. It's a user class, so if you're
> compiling your class for instance, in directory c:\myclasses, then you
have
> to include c:\myclasses in the classpath.
>
> I understand for what you say, that you are including ALL .jar files that
> come with JDK. Well I don't think it's necessary, for example, you
certainly
> don't need to include src.jar (!!).
>
> As you see the problem wasn't at compile time, it was when meiyi tried to
> run it.
>
> Luis Javier
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to