Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: Hey Guys, first time seeing this kind of error? -

  1. #1
    Member
    Join Date
    Oct 2012
    Posts
    61
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Hey Guys, first time seeing this kind of error? -

    Please help

    Exception in thread "main" java.lang.ClassNotFoundException: MyCard
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:186)
    at com.intellij.rt.execution.application.AppMain.main (AppMain.java:113)


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Hey Guys, first time seeing this kind of error? -

    The jvm could not find a definition for the MyCard class on the classpath when it tried to execute the statement at line 113.

    Where is the definition for the MyCard class? Is the MyCard.class file in a folder on the classpath?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Oct 2012
    Posts
    61
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Re: Hey Guys, first time seeing this kind of error? -

    This appeared when I tried to call the method MyCard by typing MyCard gui = new MyCard(); into the main, I am following school notes.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Hey Guys, first time seeing this kind of error? -

    You need to provide the java program with a MyCard.class file with the definition of the MyCard class to be able to execute the code.

    Where is the definition of the class: MyCard that was used when you compiled the program?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Oct 2012
    Posts
    61
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Re: Hey Guys, first time seeing this kind of error? -


  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Hey Guys, first time seeing this kind of error? -

    Sorry I have no idea what that image's contents means.
    It's mostly unreadable.

    If you are having troubles with your IDE, try asking about it in the IDE section:
    http://www.javaprogrammingforums.com/java-ides/

    EDIT: The trouble I was talking about was setting the IDE's classpath so the java program could find the class definition.
    Last edited by Norm; January 24th, 2013 at 11:39 AM. Reason: Added comment re classpath
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Member
    Join Date
    Oct 2012
    Posts
    61
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Re: Hey Guys, first time seeing this kind of error? -

    Its a print screen from intellij, could you please have a look by zooming in (Ctrl and +)

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Hey Guys, first time seeing this kind of error? -

    Sorry, I don't know how to read what your IDE shows.

    If there are error messages, copy them and paste them here.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Hey guys!
    By Shenaniganizer in forum Member Introductions
    Replies: 1
    Last Post: October 31st, 2012, 02:28 PM
  2. Hey guys:)))
    By mimka15 in forum Member Introductions
    Replies: 0
    Last Post: April 26th, 2012, 01:27 PM
  3. Calculation error...very New to Java..please be kind.
    By medicinaluser in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 1st, 2011, 11:16 PM
  4. Hey guys
    By felixchon in forum Member Introductions
    Replies: 1
    Last Post: March 13th, 2011, 08:50 AM
  5. Hey guys
    By StarKannon in forum Member Introductions
    Replies: 2
    Last Post: February 2nd, 2011, 04:58 AM