Java file is compiling but not running.
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi All,
Im new to java and i wrote a new java program which will display hello world. I named the java file as Hello.Java and the file resides in my D drive. When i compiled it it worked fine. But when i try to run it i got an error as below,
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
Can someone help me with this error?
Im new to java and i wrote a new java program which will display hello world. I named the java file as Hello.Java and the file resides in my D drive. When i compiled it it worked fine. But when i try to run it i got an error as below,
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
Can someone help me with this error?
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Can we see the source code?
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Rajesh Shekar
Greenhorn
Posts: 8
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Please find the code below
Greg Brannon
Bartender
Posts: 563
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Is the name of the source file "Hello.java"? If not, it should be.
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
posted 13 years ago
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
How are you running the code? The command should be something like "java -cp . Hello" while you are in the same directory as the Hello.class file.
Rajesh Shekar
Greenhorn
Posts: 8
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Yes i run from command line what does cp means?
Tim Moores
Bartender
Posts: 7645
178
posted 13 years ago
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Rajesh Shekar
Greenhorn
Posts: 8
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi All,
Thanks a lot to all of the friends here after setting the class path my code worked fine.
Thanks a lot to all of the friends here after setting the class path my code worked fine.

| Are you here to take over the surface world? Because this tiny ad will stop you! Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |









