Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » I need help!(Exception in thread "main" java.lang.NoClassDefFoundError:)
I need help! [message #720291] Tue, 30 August 2011 10:23 Go to next message
Jan Erik is currently offline Jan ErikFriend
Messages: 1
Registered: August 2011
Junior Member
I study computer technology first year. And I´ve written this program :
public class Program4b
{
public static void main(String[]args)
{

double lengde=5.0; //legg inn grunnflatens lengde
double hoyde=6.0; //legg inn trekantens hoyde

double svar=(lengde*hoyde)/2; // gjør beregning


System.out.println("Arealet til trekanten er:"+svar+"cm2"); //skriv ut
}
}

But I keep getting the same console error no matter what I do:

Exception in thread "main" java.lang.NoClassDefFoundError: Program4
Caused by: java.lang.ClassNotFoundException: Program4
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)

I need help to fix this, is there anyone who knows what to do?

All help will be appreciated Smile
Re: I need help! [message #720937 is a reply to message #720291] Wed, 31 August 2011 14:01 Go to previous message
Walter Laan is currently offline Walter LaanFriend
Messages: 8
Registered: July 2009
Junior Member
The error tells you want is wrong. I'll point out the relevant parts:

public class Program4b

Caused by: java.lang.ClassNotFoundException: Program4

Note that this not really related to Eclipse, a better forum would be:
forums.oracle.com/forums/forum.jspa?forumID=921
Previous Topic:Stepping into decompiled code without debug
Next Topic:Library problem
Goto Forum:
  


Current Time: Fri Feb 07 09:33:33 GMT 2025

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

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

Back to the top