NoClassDefFound Error! Please Help!
I'm getting the NoClassDefFound Error when running this. Please note I'm very new to java.
Heres my code:
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!
Re: NoClassDefFound Error! Please Help!
Please edit your post and wrap the code in code tags.
Quote:
getting the NoClassDefFound Error
Please copy the full text of the error message and paste it here. It has important info about the error.
Re: NoClassDefFound Error! Please Help!
added the full error message.
Re: NoClassDefFound Error! Please Help!
Quote:
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