algorithmicCoder
algorithmicCoder

Reputation: 6789

classes.jar issue in HelloWorld : Eclipse on Mac

When I run this HelloWorld.java program below

public class HelloWorld {

     public static void main (String [] args) {


        System.out.println("Hello World");


    }   


}

after installing the latest version of Eclipse on my Mac OS 10.7.2, I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: 
Caused by: java.lang.ClassNotFoundException: 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Upon clicking on the URLClassLoader exception i see this:

/System/Library/Java/JavaVM.framework/Versions/1.6.0.jdk/Content/Classes/classes.jar has no source attachment

This is a super basic program I'm trying to run and i'm having these issues with the mac...all help is appreciated!

Thanks

Upvotes: 2

Views: 3206

Answers (1)

algorithmicCoder
algorithmicCoder

Reputation: 6789

This worked: Editing the buildpath for the project to use the default Mac OSX java runtime environment. Eclipse was previously pointing specifically to the java 1.6 sdk. I did not have to download and install anything.

Upvotes: 2

Related Questions