Results 1 to 4 of 4
  1. #1
    jeepcreep11 is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Default java.lang.NoClassDefFoundError:

    So I have Vista, 64 bit OS,
    I am using JCreator,
    I get the error:
    java.lang.NoClassDefFoundError:

    I was suggested the following:
    Likely Cause:

    The most likely cause is that you have the CLASSPATH environment variable set.

    The CLASSPATH environment variable, which is optional, has a list of one or more directories in which the Java runtime

    looks for your ".class" file.

    If the CLASSPATH environment variable is not set, the Java runtime looks for your ".class" file in the current

    directory, which is what you want.

    ----

    How can I get rid of the CLASSPATH environment variable?

    1) Right click the "My Computer" icon and select "Properties";
    2) On the "System Properties" dialog box, click the "Advanced" tab;
    3) On the "Advanced" tab, click the "Environment Variables" button;
    4) Scroll through the "User Variables for..." listbox and look for an entry for CLASSPATH. If you find one, select it

    and click the "Delete" button;
    5) Scroll through the "System variables" listbox and look for an entry for CLASSPATH. If you find one, select it and

    click the "Delete" button;
    6) On the "Environment Variables" dialog box, click the "OK" button;
    7) On the "System Properties" dialog box, click the "OK" button;

    ----

    How can I verify that the CLASSPATH environment variable has been deleted?

    1) Click the "start" button on the Windows taskbar;
    2) Select "Run...";
    3) In the "Run" dialog box, enter "CMD" in the Open listbox, then click the "OK" button;
    4) In the command-line window, type: set CLASSPATH
    5) Press ENTER, which should display: Environment variable CLASSPATH not defined

    ----

    So in Vista I do the above instructions and I go to and I get the desired:
    Environment variable CLASSPATH not defined

    So its not a VISTA 64 thing?

    the other thing I think it might be is I just went to Jcreator and hit NEW and then JAVA file, I do not have a seperate .class file,
    how do I make the appriate .class file out of the .java file if that is the case.

    Thanks, I appreciate any help, I am very new to this and am trying to do an online class by myself.

    If its not an OS problem, or a missing .class file, I will post the code, but since its an online class, I am trying to avoid putting my work online unless neccessary

    -Beginner

  2. #2
    jeepcreep11 is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Default

    to clarify, the file is named
    Ch02Program.java

    After I hit RUN,
    I get :
    Build Output-
    --------------------Configuration: <Default>--------------------
    C:\Users\Desktop\CH02\Ch02Program.java:34: ';' expected
    averageOfIntegers = (sumOfIntegers / 3) // A-12
    ^
    C:\Users\Desktop\CH02\Ch02Program.java:42: ';' expected
    maximumInteger = firstInteger // A-21
    ^
    2 errors

    Process completed.


    General Output-
    --------------------Configuration: <Default>--------------------
    java.lang.NoClassDefFoundError: task_04_02_ch02
    Exception in thread "main"
    Process completed.

  3. #3
    jeepcreep11 is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Default

    A-12 and A-21 seem to be the problem lines of code?
    its hard to know if its something stupid like incorrect spacing or such when all's I have is a textbook to learn from.

  4. #4
    jeepcreep11 is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Default

    Ok, so I had INTEGER instead of integers on one line, and I also left out a semicolon

Similar Threads

  1. java.lang.NoClassDefFoundError
    By noobie in forum Java Applets
    Replies: 5
    Last Post: 04-22-2009, 03:35 AM
  2. java.lang.NoClassDefFoundError: com.ibm.ws.orb.GlobalORBFactory
    By hawkeye in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 06-16-2008, 11:56 AM
  3. java.lang.NoClassDefFoundError
    By bizmut in forum Eclipse
    Replies: 3
    Last Post: 06-15-2008, 01:54 AM
  4. java.lang.NoClassDefFoundError
    By J_a_y in forum New To Java
    Replies: 2
    Last Post: 08-07-2007, 12:51 PM
  5. java.lang.NoClassDefFoundError
    By fred in forum Advanced Java
    Replies: 3
    Last Post: 08-01-2007, 06:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •