SOS: Faulty Java Interpreter

Discussion in 'QnA (read only)' started by poweruser, Sep 9, 2004.

Thread Status:
Not open for further replies.
  1. poweruser

    poweruser New Member

    Joined:
    Sep 9, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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?
     
  2. aadipa

    aadipa New Member

    Joined:
    Feb 12, 2004
    Messages:
    997
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Palghar, Mumbai
    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
     
  3. OP
    OP
    poweruser

    poweruser New Member

    Joined:
    Sep 9, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  4. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    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...
     
  5. rahul

    rahul New Member

    Joined:
    Sep 29, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    india
    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
     
  6. rahul

    rahul New Member

    Joined:
    Sep 29, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    india
    Re: jdk 1.5

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

    No wonder the forum lists me as Analogue Novice :oops:
     
  7. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    Re: jdk 1.5

    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...
     
Thread Status:
Not open for further replies.

Share This Page