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 7 of 7

Thread: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

  1. #1
    Member Scotty's Avatar
    Join Date
    Oct 2010
    Posts
    60
    My Mood
    Scared
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    Eclipse was running running fine, but now I get this error every time I try to compile:

    Exception in thread "main" java.lang.NoClassDefFoundError: DrawConnect4
    Caused by: java.lang.ClassNotFoundException: DrawConnect4
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    Could not find the main class: DrawConnect4. Program will exit.

    This is for all my classes.

    Ubuntu 10.10

    PLease Help. I am new to eclipse (and fairly new to java and GNU/Linux).


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,235
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    The JVM cannot find the class DrawConnect4 - make sure it is in your project or the library that contains the class is on your classpath.

  3. #3
    Member Scotty's Avatar
    Join Date
    Oct 2010
    Posts
    60
    My Mood
    Scared
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    All the classes disappeared when I started getting that error - I thought it created the classes when it ran the java files? Or as it went along, as I could also run them from the terminal, but never compiled them since I started using eclipse. Thing is this is due in tomorrow, so I dont have time to learn how it works . Is also imports a file the normal compiler (though terminal) cant get and I dont have time to fix.
    Last edited by Scotty; March 27th, 2011 at 10:16 AM.

  4. #4
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,235
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    Helping one with their IDE remotely like this is difficult, as there are so many details involved as to where the source files are, if they were imported, what type of project you are working from, etc...for what its work go to the project menu and make sure Build Automatically is checked. If you have a deadline and not time to troubleshoot then use what works - if the command line worked before go with that.

  5. The Following User Says Thank You to copeg For This Useful Post:

    Scotty (March 27th, 2011)

  6. #5
    Member Scotty's Avatar
    Join Date
    Oct 2010
    Posts
    60
    My Mood
    Scared
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    The command line doesnt work - thats why I am using eclipse. Eclipse suddenly doesnt work...

  7. #6
    Member Scotty's Avatar
    Join Date
    Oct 2010
    Posts
    60
    My Mood
    Scared
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    Build automatically was not selected, but how I have selected it, it looks right. I still get the error though. Anything else I would need to do?

  8. #7
    Member Scotty's Avatar
    Join Date
    Oct 2010
    Posts
    60
    My Mood
    Scared
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    Works now, Thank you! (And I set the classpath so my terminal works in Ubuntu too )

Similar Threads

  1. Replies: 23
    Last Post: July 4th, 2014, 06:53 PM
  2. What is wrong with my code? JAVA-Eclipse
    By bespinoz in forum Loops & Control Statements
    Replies: 9
    Last Post: November 17th, 2012, 03:06 PM
  3. eclipse java simple example
    By aswra1 in forum Object Oriented Programming
    Replies: 2
    Last Post: March 24th, 2011, 10:21 AM
  4. Help with Java assignment - Eclipse
    By jake6047 in forum Java Theory & Questions
    Replies: 0
    Last Post: March 12th, 2011, 08:45 PM
  5. Java Tip Jul 5, 2010 - [Eclipse IDE] Navigating through code
    By helloworld922 in forum Java JDK & IDE Tutorials
    Replies: 1
    Last Post: July 5th, 2010, 06:28 AM