How to eliminate error," Could not find the main class: filecopy.FileCopy. Program will exit." ?

How to eliminate error," Could not find the main class: filecopy.FileCopy. Program will exit." ?

run: java.lang.NoClassDefFoundError: filecopy/FileCopy Caused by: java.lang.ClassNotFoundException: filecopy.FileCopy 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) Could not find the main class: filecopy.FileCopy. Program will exit. Exception in thread "main" Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)

View Answers

April 28, 2011 at 11:20 AM

What is filecopy in your code? Is it a package and FileCopy is a java file? There may be contradiction.









Related Tutorials/Questions & Answers:

Ads