SOS: Faulty Java Interpreter

Status
Not open for further replies.

poweruser

Right off the assembly line
i have windows XP sp1, athlon 2000+, 256Mb RAM and nforce m/b with 40GB baracudda. i recently installed JDK1.5. the problem is that when i compile my program from console, they compile fine, but when i exceute them with (java) interpreter i get an error :
exception in "main" noclassdeffounderror: demo (<-- file name)

the same jdk worked fine earlier.

please can anyone guide me?
 

aadipa

Padawan
check for CLASSPATH environmental variable.

if u don't use "package" for ur program then, classpath should be current directory.

try this command before running ur program
SET CLASSPATH=.

or if u have some extra library files then
SET CLASSPATH=%CLASSPATH%;.

this should solve ur problem
 
OP
P

poweruser

Right off the assembly line
classpath set

i have tried everything from setting the classpath to reinstalling the jdk1.5. i even installed jdk1.3 , but again i am able to compile programs from the console yet it gives problem regarding the execution
 

GNUrag

FooBar Guy
Change your environment variable settings in windows XP and add a new env variable called CLASSPATH

CLASSPATH=C:\jdk1.5\jre\lib\rt.jar;.

notice the dot in the last. If this doesnt work then you sure are not following the steps right...
 

rahul

Right off the assembly line
jdk 1.5

1. I haven't work with the RC1, but older betas of 1.5 , and also the prototype compilers. If the demo you are compiling is for somethin specific for java 1.5 (like generics),
To compile with Beta version use:

javac -source 1.5 aa.java

2. anyway , first try checking that the class defined inside demo.java is not Demo.java (d-D) or something (to err, as they say.....) :)

Hope it helps. Please keep us posted abt. the result.
-Rahul
 

rahul

Right off the assembly line
Re: jdk 1.5

rahul said:
2. anyway , first try checking that the class defined inside demo.java is not Demo.java (d-D) or something (to err, as they say.....) :)

-Rahul
I meant "class defined inside demo.java is not Demo (d-D) or something "

No wonder the forum lists me as Analogue Novice :oops:
 

GNUrag

FooBar Guy
Re: jdk 1.5

rahul said:
No wonder the forum lists me as Analogue Novice :oops:
Every In-house-geek was an Analog Novice some day !!! and as you said... to err is human... you could have edited your post instead of making a new post...
 
Status
Not open for further replies.
Top Bottom