Results 1 to 4 of 4
  1. #1
    ItsRoland is offline Member
    Join Date
    Sep 2015
    Posts
    2
    Rep Power
    0

    Default NoClassDefFound Error! Please Help!

    I'm getting the NoClassDefFound Error when running this. Please note I'm very new to java.
    Heres my code:

    Java Code:
    class DoMath {
    	
    
    	
    	public static void main(String[] arguents){
    	
    	double velocity = 0;
    	double accel = 0;
    	double time = 0;
    	
    	
    	System.out.println("Please enter the value for acceleration"); //promts user to input value for velocity
    	
    	double input = accel ; //accepts user input for acceleration
    	
    	System.out.println("Please enter the value for time in free fall"); //promts user to input value for time
    	
    	input = time ; //accepts user input for time
    	
    	velocity = 0.5 * accel * time ;
    	
    	System.out.println(velocity);
    }
    }
    Heres the full error code:
    Exception in thread "main" java.lang.NoClassDefFoundError: gravcalc (wrong name: gravcalc/gravcalc)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :800)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 361)
    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 25)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 58)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Launc herHelper.java:482)


    ------------------
    (program exited with code: 1)
    Press return to continue



    Any help is appreciated!
    Last edited by ItsRoland; 09-24-2015 at 11:42 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,964
    Rep Power
    31

    Default Re: NoClassDefFound Error! Please Help!

    Please edit your post and wrap the code in code tags.
    getting the NoClassDefFound Error
    Please copy the full text of the error message and paste it here. It has important info about the error.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    ItsRoland is offline Member
    Join Date
    Sep 2015
    Posts
    2
    Rep Power
    0

    Default Re: NoClassDefFound Error! Please Help!

    added the full error message.
    Last edited by ItsRoland; 09-24-2015 at 11:47 PM.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,964
    Rep Power
    31

    Default Re: NoClassDefFound Error! Please Help!

    Exception in thread "main" java.lang.NoClassDefFoundError: gravcalc (wrong name: gravcalc/gravcalc)
    What command did you enter to get that message?
    How is that error message related to the posted code? The posted code has class: DoMath; the error message has class: gravcalc
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. JApplet Error, NoClassDefFound
    By Deep in forum Java Applets
    Replies: 0
    Last Post: 02-01-2014, 10:33 AM
  2. NoClassDefFound error using PDFBox
    By Aminaz in forum New To Java
    Replies: 1
    Last Post: 04-29-2012, 10:38 AM
  3. JPA application noclassdeffound error
    By ishakteyran in forum New To Java
    Replies: 2
    Last Post: 03-12-2010, 07:31 PM
  4. JPA application noclassdeffound error
    By ishakteyran in forum Advanced Java
    Replies: 2
    Last Post: 03-11-2010, 01:14 AM
  5. JPA application noclassdeffound error
    By ishakteyran in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 03-11-2010, 12:34 AM

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
  •