Results 1 to 13 of 13

Thread: Help?!?!

  1. #1
    blackstardlb is offline Member
    Join Date
    Jun 2011
    Posts
    10
    Rep Power
    0

    Default Help?!?!

    I'm trying to run a basic Hello APP using CMD and getting rely frustrated with this error

    C:\Users\user> cd C:\java

    C:\Java>dir
    Volume in drive C has no label.
    Volume Serial Number is 5284-E7DA

    Directory of C:\Java

    06/04/2011 07:29 PM <DIR> .
    06/04/2011 07:29 PM <DIR> ..
    06/04/2011 07:29 PM 15,225 GateStones.java
    06/12/2011 06:44 PM 432 HelloWorldApp.class
    05/25/2011 10:06 PM 267 HelloWorldApp.java
    3 File(s) 15,924 bytes
    2 Dir(s) 253,962,170,368 bytes free

    C:\Java>java HelloWorldAPP.java
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldAPP/java
    Caused by: java.lang.ClassNotFoundException: HelloWorldAPP.java
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: HelloWorldAPP.java. Program will exit.
    Last edited by blackstardlb; 06-14-2011 at 01:38 AM.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    Please use a meaningful title. We assume the reason your are posting os to get help.

    Please ask a specific question. Do not just dump code or stacktrace and expect us to fix it for you.

  3. #3
    blackstardlb is offline Member
    Join Date
    Jun 2011
    Posts
    10
    Rep Power
    0

    Default

    sorry im new >.<

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    Ahhh, I didn't realise you had never tried communicating with another person before. The points I made (and many others) are simply common sense and nothing to do with how a forum works.

    To answer your unasked question:

    Compile
    Java Code:
    javac Classname.java
    Run
    Java Code:
    java Classname
    Notice the difference

  5. #5
    blackstardlb is offline Member
    Join Date
    Jun 2011
    Posts
    10
    Rep Power
    0

    Default

    Tried that and still getting the same error and as u can see when i do dir the class file is already compiled.

  6. #6
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    Post your new stacktrace.

  7. #7
    blackstardlb is offline Member
    Join Date
    Jun 2011
    Posts
    10
    Rep Power
    0

    Default

    Java Code:
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Java>javac HelloWorldAPP.java
    
    C:\Java>java HelloWorldAPP
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldAPP
    Caused by: java.lang.ClassNotFoundException: HelloWorldAPP
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: HelloWorldAPP.  Program will exit.

  8. #8
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    Java is case sensitive.

  9. #9
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    06/04/2011 07:29 PM 15,225 GateStones.java

    Holy carp! What is that?

  10. #10
    blackstardlb is offline Member
    Join Date
    Jun 2011
    Posts
    10
    Rep Power
    0

    Default

    How i typed it is exactly how its saved. And that's some other program should i delete/move it?

  11. #11
    blackstardlb is offline Member
    Join Date
    Jun 2011
    Posts
    10
    Rep Power
    0

    Default

    Still giving the same error after i moved it.

  12. #12
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    05/25/2011 10:06 PM 267 HelloWorldApp.java
    C:\Java>java HelloWorldAPP

    Not the same!

  13. #13
    blackstardlb is offline Member
    Join Date
    Jun 2011
    Posts
    10
    Rep Power
    0

    Default

    Finally cant believe i've been making such a stupid mistake thank you!!!

Tags for this Thread

Posting Permissions

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