NoClassDefFoundError

Discussion in 'Java' started by Monsieur Le Maire, Jul 21, 2003.

  1. I have this error when I try to run a program, it can't
    find the main class, although I created all the necessary
    files.

    I have
    ApplicationFrction.java
    Fraction.Java
    read_int.java

    all the java program start with a package fraction. I run java but
    always get NoClassDefFoundError it can't find the main class. I
    played with CLASSPATH variable, I called the mainclass
    fraction.ApplicationFraction

    Could it be there's a conflict between the package fraction and the
    class fraction ...


    batch file:
    C:\j2sdk1.4.2\bin\javac.exe *.java

    C:\j2sdk1.4.2\bin\jar cf tp2.jar *.class

    C:\j2sdk1.4.2\bin\jar cmf mainclass tp2.jar *.class

    C:\j2sdk1.4.2\bin\java -jar tp2.jar

    C:\j2sdk1.4.2\bin\jar tvf tp2.jar

    main class file

    Main-Class: fraction/ApplicationFraction
    Monsieur Le Maire, Jul 21, 2003
    #1
    1. Advertising

  2. Monsieur Le Maire

    ghl Guest

    "Monsieur Le Maire" <> wrote in message
    news:...
    > I have this error when I try to run a program, it can't
    > find the main class, although I created all the necessary
    > files.
    >
    > I have
    > ApplicationFrction.java
    > Fraction.Java
    > read_int.java
    >
    > all the java program start with a package fraction. I run java but
    > always get NoClassDefFoundError it can't find the main class. I
    > played with CLASSPATH variable, I called the mainclass
    > fraction.ApplicationFraction
    >

    See: http://jinx.swiki.net/61 for information on proper classpath to the jar
    file, making the jar file double-clickable, and other package/classpath
    usage.
    I believe your manifest file has bad format for the Main-Class: entry.
    --
    Gary
    ghl, Jul 21, 2003
    #2
    1. Advertising

  3. Monsieur Le Maire

    Roedy Green Guest

    Roedy Green, Jul 21, 2003
    #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. qazmlp
    Replies:
    6
    Views:
    13,400
    Joseph Millar
    Jul 11, 2003
  2. netpro2k
    Replies:
    2
    Views:
    1,069
    netpro2k
    Aug 21, 2003
  3. keith
    Replies:
    0
    Views:
    304
    keith
    Oct 17, 2003
  4. Brian Whitney
    Replies:
    0
    Views:
    561
    Brian Whitney
    Nov 5, 2003
  5. Replies:
    1
    Views:
    2,118
    Irmen de Jong
    Jun 22, 2004
Loading...

Share This Page