Broken Eclipse project - classNotFoundException - could not find the main class

I have a project that I was developing in Eclipse 3.7.2 on Ubuntu 12.04. I recently changed the class hierarchy, which included moving classes between packages. I did not move my main class ("ob3.converter.Converter"), which contains my method public static void main(String[] args).

Now, when I try to run it, I get:

Exception in thread "main" java.lang.NoClassDefFoundError: ob3/converter/Converter
Caused by: java.lang.ClassNotFoundException: ob3.converter.Converter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: ob3.converter.Converter. Program will exit.

I just worked (in java) with Eclipse, which handles all the overhead for me, so I have little knowledge of this error or what might cause it. I looked through my Run Configuration / Classpath, etc., but without knowing what to look for, it was fruitless.

- ? googled/search SO, , . , .

:

  • "" "ob3.converter".
  • "" public static void main(String[] args).
  • "" " Java" " " "/lib" "converter/src" - 2 .
  • JRE, Run Configuration/JRE, "java-6-openjdk-amd64".
  • " ClassPath" " " :
    • Boostrap:
      • JRE [java-6-openjdk-amd64]
    • :
      • ( )
  • Converter.java .

!

+5
2

, . , "" > ""...

Eclipse .

+2

. linux, , java, jars .

0

All Articles