• CONTEST ALERT - Experience the power of DDR5 memory with Kingston Click for details
Status
Not open for further replies.
hey u guys,
im in a fix,m i got this problem with java..
Whenver i try to run a progrm, i get an error saying "NoClassDefFoundError", although the program is compiled well!!!

Plz help me, im running windows XP, java was runnning well before on XP, i lately am experiencing this problem,.....
 

pradeep_chauhan

Cyborg Agent
add a variable called CLASSPATH in your local variables indicating the location of your class file and also the jre/jdk class files.
 

#/bin/sh

Journeyman
means that your classpath is not set correctly. Make sure your JAVA_HOME is set up right before you run the startup scripts.
 

#/bin/sh

Journeyman
post you're source code,
it will help to solve you're problem & and let me know what you doing with?
 

GNUrag

FooBar Guy
for UNIX:
add this to your /etc/profile

CLASSPATH=/usr/jdk/jre/lib/rt.jar:.
export CLASSPATH


for WinXP,
add the path to your CLASSPATH environment variable.
CLASSPATH=C:\jdk\jre\lib\rt.jar;.


Notice the dot in the end... it refers to the class file that is in ur current directory...
 
OP
C

cockyrudh_2020

Broken In
well i tried everything you guys suggested, but of no use

my java folder is in D:/java
bin is in D:/java/bin

all my programs which used to compile earlier no longer work! im in a fix plz helpme
---ANIRUDH
 

#/bin/sh

Journeyman
If you can't compile, your PATH probably needs to be set.

c:/>set PATH=%PATH%;d:/java/bin

You can permanently set this by going to (WinXP) Start>Settings>System, Advanced tab, Environmental Variables
What do you get if you type in
java - version

If your system can't find this, it is a path problem. You can either set the path, or make it explicit:
d:/java/bin/javac MyClass.java //to compile
d:/java/bin/java -cp . MyClass //to run
 
Status
Not open for further replies.
Top Bottom