Results 1 to 5 of 5
  1. #1
    questionortwo is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default "could not find or load main class"

    I have converted a file titled "HelloApp.java" into "HelloApp.class" but when IO try to run HelloApp.class
    the above error occurs.

    Is it normal that my "Java" folder has jre6 AND jre7 in it?

    Anyway, my CLASSPATH is
    C:\Program Files\Java\jre6\lib\ext\QTJava.zip

    and my PATH is
    C:\Program Files\Java\jdk1.7.0\bin;%CommonProgramFiles%\Micro soft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoo t%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;

    where am I going wrong?
    Last edited by questionortwo; 09-30-2011 at 01:07 AM.

  2. #2
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    3

    Default Re: "could not find or load main class"

    That error is talking about your actual file.
    It cannot find a main class within your program.

    So, in that case, do you have:
    Java Code:
    public static void main(String args[]) {
    
    }
    In your code?

    Regards, James.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: "could not find or load main class"

    It cannot find a main class within your program.
    Its the main() method that the JVM is looking for

  4. #4
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    3

    Default Re: "could not find or load main class"

    Its the main() method that the JVM is looking for
    Sorry, i didn't readover what i wrote.

  5. #5
    questionortwo is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default Re: "could not find or load main class"

    I figured it out thank you guys

Similar Threads

  1. Replies: 11
    Last Post: 08-18-2011, 10:54 PM
  2. Error message "could not find the main class"
    By srwpchelp in forum New To Java
    Replies: 8
    Last Post: 12-23-2010, 09:15 PM
  3. Replies: 3
    Last Post: 08-25-2010, 10:21 AM
  4. Replies: 6
    Last Post: 05-18-2010, 05:11 PM
  5. Replies: 1
    Last Post: 06-30-2009, 02:32 PM

Posting Permissions

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