Results 1 to 4 of 4

Thread: Newbbie

  1. #1
    newbbie is offline Member
    Join Date
    May 2010
    Posts
    1
    Rep Power
    0

    Default Newbbie

    I am getting a ClassNotFound error when attempting to run HelloWorld.class, please see my attachment for the source code.
    Attached Files Attached Files

  2. #2
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    Rather than an attachment, why not just post your code here? If you do so, please use code tags where you place the tag:

    [code]

    above your block of code, and the tag:

    [/code]

    below the block of code.

    Also, how are you trying to compile and run this code?

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    ClassNotFound error
    Your error is at runtime so the source isn't any help.
    Could you explain how you are executing the program.
    Also copy and paste here the FULL contents of the error message.
    Last edited by Norm; 05-30-2010 at 04:10 PM.

  4. #4
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by newbbie View Post
    I am getting a ClassNotFound error when attempting to run HelloWorld.class, please see my attachment for the source code.
    the java-code is ok. compile it with

    javac HelloWorldApp.java

    and then change to the directory where the HelloWorldApp.class is and then type

    java HelloWorldApp

    Watch out: java is case sensitive and the name HelloWorldApp must match exactly the class name where the main() method is in, the source-file HelloWorldApp.java and the class-file HelloWorldApp.class. When you type java HelloWorldApp then java is searching for the main-method in the HelloWorldApp class-file and if the name is for example HelloWorld the error ClassNotFound is shown, because the name given in java and in the class are not the same.
    Last edited by j2me64; 05-30-2010 at 10:19 AM.

Posting Permissions

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