C:\Program Files\Java>javac Jyo.java
C:\Program Files\Java>java Jyo
Exception in thread "main" java.lang.NoClassDefFoundError: Jyo
Caused by: java.lang.ClassNotFoundException: Jyo
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: Jyo. Program will exit.
THIS IS THE PROBLEM PLZZZ HELP MEHHH
Hello there :
first you are going to want to ensure that your your current version of java is installed correctly and is not corrupted and if it needs to be reinstalled
download the latest java version and reinstall this . www.java.com
this should be able to take care of the problem that you are having ok?
best regards michael
Are you sure Jyo.java is in the directory of the C:\Program Files\Java folder?
Try compiling from where the Jyo.java file resides instead:
ex.
cd c:\mysourcefolder\
javac Jyo.java
Please check the generated class name after compilation. You need to run with generated class file name not with file name of the class
Only read on if you have the latest version of the JDK:
It seems you have not established the class correctly. Make sure your class declaration is:
public class Jyo
also that your main class is declared as so:
public static void main(String[] args)
and that if you are instantizing the class that the constructor is declared as so:
public Jyo
If you have done all of these correctly, you may want to consider posting your code.
Hope that helps,
Tiger720
722 views
Usually answered in minutes!
×