simple classpath question`

Discussion in 'Java' started by cppaddict, Sep 24, 2006.

  1. cppaddict

    cppaddict Guest

    I thought I understood classpaths, but I encountered an error I could
    not explain.

    I have my classpath set to:

    C:\Project1;C:\Project2

    Note that these folders are not packages themselves, but are the root
    folders containing all the package folders and class files.

    One class contained inside of a package in Project2 imports and uses a
    class contained inside of package in Project1. I am getting a
    NoClassDef found error. I could have sworn that this has worked
    before.

    Can someone set me straight on how I need to set this up?

    Thanks in advance,
    cpp
    cppaddict, Sep 24, 2006
    #1
    1. Advertising

  2. cppaddict

    Chris Smith Guest

    cppaddict <> wrote:
    > I have my classpath set to:
    >
    > C:\Project1;C:\Project2
    >
    > Note that these folders are not packages themselves, but are the root
    > folders containing all the package folders and class files.
    >
    > One class contained inside of a package in Project2 imports and uses a
    > class contained inside of package in Project1. I am getting a
    > NoClassDef found error. I could have sworn that this has worked
    > before.
    >
    > Can someone set me straight on how I need to set this up?


    There's nothing wrong with anything that you posted. Is there any
    additional information in the NoClassDefFoundError? For example, if it
    includes the words "wrong name", then that'll be a clue that helps a
    lot.

    As a sort of long shot, are you running application with java -jar? Or
    with the -classpath option to the JVM? Either of those will prevent the
    JVM from checking your classpath environment variable.

    Failing any of that, it's probably best for you to poke around and look
    for any additional information you can provide on the problem; enough
    for someone to try to reproduce it (I don't get an error with the setup
    you describe above).

    --
    Chris Smith
    Chris Smith, Sep 24, 2006
    #2
    1. Advertising

  3. cppaddict

    cppaddict Guest


    >There's nothing wrong with anything that you posted.


    Thanks Chris. I just wanted to make sure my understanding wasn't
    flawed. Probably something simple then. I'll take another look.
    cppaddict, Sep 24, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flip
    Replies:
    3
    Views:
    7,259
    Tony Morris
    Feb 9, 2004
  2. Gabe
    Replies:
    3
    Views:
    1,073
  3. Replies:
    2
    Views:
    752
  4. RalphLeon

    Java Classpath - Simple Question

    RalphLeon, Aug 3, 2007, in forum: Java
    Replies:
    3
    Views:
    398
    Mike Schilling
    Aug 3, 2007
  5. Replies:
    2
    Views:
    1,105
    Mike Schilling
    Mar 2, 2008
Loading...

Share This Page