Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

NoClassDefFoundError

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my class file "Hello.class" is inside the package "rmi".
"rmi" folder is in c:
I am getting NoClassDefFoundError while executing "Hello" from c:> or from c:\rmi>
I tried setting classpath as %classpath%;c:\; and %classpath%;c:\rmi\; etc
but i could not solve the problem
The code of Hello.java is as:
public class Hello
{
public static void main(String a[])
{
System.out.println("hei");
}
}

please help
all the best and advance thanks.

Added on 30.04.2008 only like java rmi.Hello works, it seems no way to use like java Hello
[ April 30, 2008: Message edited by: seetharaman jayaraman ]
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am getting NoClassDefFoundError while executing "Hello" from c:> or from c:\rmi>


I guess you have not compiled Hello.java, hence the error.
And to execute the program you need to say java Hello and not just "Hello"


Hope this helps
 
Marshal
Posts: 74696
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . and have you got ;. or ;.; or .; anywhere in your classpath? On windows you ought to have at least one of those three (though it doesn't seem to do any harm to have all three!).
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started this game too. I've found that Windows XP does not like the "%" at all. Also, if you go and change your path, close your command promt. I hope this help some.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI ram,

better you set classpath in your envoronment variable...give java class file folder path to the classpath..

thanks & regards,
seetharaman
 
Campbell Ritchie
Marshal
Posts: 74696
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by seetharam venk:
HI ram,

better you set classpath in your envoronment variable...give java class file folder path to the classpath..

thanks & regards,
seetharaman

Disagree. You want the folder with java.exe (for Windows) to be in the PATH, and you want a . for current directory in your classpath. Any classpath setting can be left for more advanced programming, and you can do that from the command line or a manifest file in a .jar.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Campbell Ritchie,

well, to use javac,you need path variable right?..i was saying about to run a java file(i.e,to use java) you need classpath..

thanks & regards,
seetharaman
 
Campbell Ritchie
Marshal
Posts: 74696
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You usually only need to set the classpath if you have executable .class files in several folders. So, you don't usually need to set the classpath for executing simple Java applications.
You virtually always need the PATH set to get anything to execute.
reply
    Bookmark Topic Watch Topic
  • New Topic