Error when running my 1st program


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Error when running my 1st program

  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unhappy Error when running my 1st program

    Below is my 1st Java pgm from an online course. I'm getting the error on the last line. I think it has to do with my environment, any help would be appreciated:

    class BigDebt {
    public static void main (String[] arguments) {
    int debt = 446000000;
    debt = debt / 1440;
    System.out.println("A minute's worth of debt is $" + debt);
    }
    }
    // C:\jv1\Unit2\bigdebt1>java BigDebt
    // Exception in thread "main" Java.lang.NoClassDefFoundError: BigDebt

    Thanks in advance,
    Thanks in advance,
    Jerry

  2. #2
    Join Date
    Nov 2003
    Posts
    22
    Have you compiled the code to a .class file?

  3. #3
    Join Date
    Feb 2004
    Posts
    6

    My 1st java program

    Yes, I have compiled the code and created the BigDebt.class file.

    Thanks in advance,
    Jerry

  4. #4
    Join Date
    Feb 2004
    Posts
    808
    in the dos box, type:

    SET

    in the output, look for something like:

    CLASSPATH=C:\j2sdk1.4.2\jre\lib\rt.jar;c:\javamail-1.3.1\mail.jar;c:\jaf-1.0.2\activation.jar;.

    yours will be different, but it should finish with:

    ;.

    which means "the current directory"

    if it does not, right click my computer, choose properties >> advanced >> environment variables >> and edit the classpath entry in the second pane, to include it ( ;. )
    click OK to everything, close all dos windows, and try again
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  5. #5
    Join Date
    Feb 2004
    Posts
    6
    Thank you, thank you. Funny how minor things make a big difference. I added the semicolon and it worked.
    Thanks again cjard.....
    Thanks in advance,
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center