Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

copiling not running

Thread view: 
snowy - 21 Jan 2006 16:14 GMT
my code is here

-------------------------------------------

class ILoveJava {
public static void main(String[] args) {
System.out.println("I Love Java!");
}
}

---------------------------------------

when i compile it is showing NO errors. when i run the program using

java ILoveJava

i get this error.

----------------------------------------
Exception in thread "main" java.lang.NoClass.DefFoundError: ILoveJava
----------------------------------------

How to solve this problem ?
opalpa@gmail.com opalinski from opalpaweb - 21 Jan 2006 16:23 GMT
If you receive this error, java cannot find your bytecode file.

Read up on changing value of CLASSPATH variable.
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.htm
has documentation for a few different systems.

Opalinski
opalpa@gmail.com
http://www.geocities.com/opalpaweb/
snowy - 21 Jan 2006 16:30 GMT
hi but the link is broken. i am using winxp. pls help me. i get
compilation correctly but the program is not running.
Chris Smith - 21 Jan 2006 17:35 GMT
> hi but the link is broken. i am using winxp. pls help me. i get
> compilation correctly but the program is not running.

Try java -cp . ILoveJava

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

opalpa@gmail.com opalinski from opalpaweb - 21 Jan 2006 18:04 GMT
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html

I missed a character at the end.  I checked the above link.

Opalinski
opalpa@gmail.com
http://www.geocities.com/opalpaweb/
Jeffrey Schwab - 21 Jan 2006 17:34 GMT
> my code is here
>
[quoted text clipped - 19 lines]
>
> How to solve this problem ?

java -cp . ILoveJava

Java doesn't know to look in the current directory for the class
definition.  Add the current directory (".") to the class path using
either the -cp command line flag or the CLASSPATH environment variable.
opalpa@gmail.com opalinski from opalpaweb - 21 Jan 2006 18:12 GMT
Java looks into current directory if CLASSPATH variable is not set.
When CLASSPATH variable gets set then the stuff in CLASSPATH variable
gets used.  WHen CLASSPATH gets unset then current directory gets used.

One can also add current directory, with a ".", to the CLASSPATH
variable.

Opalinski
opalpa@gmail.com
http://www.geocities.com/opalpaweb/
Jeffrey Schwab - 21 Jan 2006 21:49 GMT
> Java looks into current directory if CLASSPATH variable is not set.
> When CLASSPATH variable gets set then the stuff in CLASSPATH variable
[quoted text clipped - 6 lines]
> opalpa@gmail.com
> http://www.geocities.com/opalpaweb/

Would ya believe I didn't know that?  Thanks!
Roedy Green - 21 Jan 2006 22:57 GMT
>NoClass.DefFoundError

see http://mindprod.com/jgloss/caq.html
http://mindprod.com/jgloss/gettingstarted.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.