File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Cattle Drive and the fly likes Hello World Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Hello World" Watch "Hello World" New topic
Author

Hello World

Tim Bachta
Greenhorn

Joined: Dec 30, 2000
Posts: 5
I ran the hello world program. It was able to compile but when I ran it I received the following message:"Exception in thread "main" java.lang.NoClassDefFoundError: Hello World " did I do something wrong?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9053
    
  12
Your class name is HelloWorld (all one word), right?
You compiled "javac HelloWorld.java" ?
You then typed "java HelloWorld" ?
From the error message, it appears that you tried to split the class name into two words (i.e. java Hello World).


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Tim Bachta
Greenhorn

Joined: Dec 30, 2000
Posts: 5
actually it is comming out as HelloWorld all one word??
I saved the file as HelloWorld.java the class anme is HelloWorld what else could be wrong?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9053
    
  12
What subdirectory are you in when you compile? What subdirectory is your HelloWorld.java file in? What is your path set to? What is your classpath set to?
Tim Bachta
Greenhorn

Joined: Dec 30, 2000
Posts: 5
They are all in the Java folder which is located in the root of C: Drive and I compile and reun in that directory
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9053
    
  12
What is your CLASSPATH set to?
Tim Bachta
Greenhorn

Joined: Dec 30, 2000
Posts: 5
This is the settings that I have
PATH=C:\windows;c:\windows\command;c:\jdk1.2\bin;C:\jdk1.2\jre\bin
CLASSPATH=C:\jdk1.2\lib;.;C:\java
I am still getting an error
Daniel Olson
Ranch Hand

Joined: Jan 05, 2001
Posts: 81
This may not be your problem, but I have gotten that error when I forget and type
java HelloWorld.java
instead of
java HelloWorld
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20729
    ∞

What operating system are you using?


permaculture Wood Burning Stoves 2.0 - 4-DVD set
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hello World