runtime error for all programs

i recently installed the jdk 1.5.0 in windows xp sp2. i have no problems in compiling a program, but whenever i run it, i get a error : "Exception in thread main : java.Lang.NoClassDefFoundError ". this error occurs for all the programs i try to run

this happens even though the class file is located in the bin directory. also i have tried reinstalling both the jre and jdk, but still no effect. what gets me confused is that the same code runs just fine on linux .

can some one help me out?

[512 byte] By [krapaa] at [2007-10-2 9:50:23]
# 1

Change the cmd window prompt to a directory that contains your .class file and issue this command:

java -cp . <nameOfYourClass>

IMPORTANT: Include the period and the surrounding spaces

If that works, learn to use the classpath, here:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#general

ChuckBinga at 2007-7-16 23:55:33 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...