Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » ClassNotFoundException
ClassNotFoundException [message #882415] Wed, 06 June 2012 12:34 Go to next message
Jonathan Camilleri is currently offline Jonathan CamilleriFriend
Messages: 91
Registered: July 2009
package coff;

public class Mammal {
{ int a = 1;
assert a == 1;
System.out.println("mammal initialized");


package coff2;
import coff.Mammal;
public class Dog extends Mammal {

public static void main(String[] args) {
assert (1 != 0) : "this should never appear...";
System.out.println("Dog extends Mammal");



Caused by: java.lang.ClassNotFoundException: coff2.Dog
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
Re: ClassNotFoundException [message #882475 is a reply to message #882415] Wed, 06 June 2012 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Does this have anything to do with Eclipse? This looks like a general
problem running a java jar. This forum is for Eclipse JDT (compilation)
problems/questions. For general java questions you need to go somewhere

Re: ClassNotFoundException [message #882480 is a reply to message #882475] Wed, 06 June 2012 14:34 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1599
Registered: July 2009
Senior Member
Well, the attached rar contains a proper Eclipse / JDT project.
If the exception occurs when running the application inside the IDE, then something's fishy in JDT/Debug.
Otherwise, (if exception ocurrs outside Eclipse) I concur that the JDT forum is not a likely place to get help for this issue.

Re: ClassNotFoundException [message #882505 is a reply to message #882480] Wed, 06 June 2012 15:38 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3157
Registered: July 2009
Senior Member

I wouldn't say it's a "proper" project--you have two JREs on the Java Build Path, and unless you've actually set up a 1.7 JRE in the preferences, your build path will be considered broken. An erroneous build path will, by default, abort the build and leave you with no class files, hence the Error at runtime.

Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:ASPECTJ Internal Compiler Error
Next Topic:Can't get my webapps to deploy from Eclipse
Goto Forum:

Current Time: Thu May 24 19:56:02 GMT 2018

Powered by FUDForum. Page generated in 0.01441 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top