944,221 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 22709
  • Java RSS
Sep 5th, 2005
0

exception in thread "main" java.lang.NoClassDefFoundError

Expand Post »
http://www.deitel.com/books/jHTP5/jH...pile%20servlet

Go here to get a better explaintion than my simple answer. I had this error and I looked all over online in many many forums. I then went back to my textbooks website which gave me the above page.
You can do two things

When compiling the fiile type javac -classpath . yourfilenam.java
when you go to run the program type java -classpath . yourfilename
You MUST add the space . space inbetween -crosspath and what you named your file.


It talks that you can change having to type the -classpah by eliminating the variable crosspath. I wouldn't mind doing that if I knew how to get the variable back if my computer objects. I don't liike to delete things if I don't know how to get it back or I definantly don't want it.

If this works for you pass it on to any forums you see.

Mary

Quote originally posted by Ghost ...
Hi,

I'm trying to run my program in command prompt, but i get this error:
Java Syntax (Toggle Plain Text)
  1. Exception in thread "main" java.lang.NoClassDefFoundError: Invaders
Can anybody tell me what this error means?

Thanx.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bert2020 is offline Offline
1 posts
since Sep 2005
Sep 6th, 2005
0

Re: exception in thread "main" java.lang.NoClassDefFoundError

Says it all really, it can't find the class.
What part of "No Classdef(inition) Found Error" don't you understand?
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jul 13th, 2010
0
Re: exception in thread "main" java.lang.NoClassDefFoundError
import java.sql.*;

class Student1
{
public static void Main(String[] ar)
{
try
{
Class.forName(
Reputation Points: 10
Solved Threads: 0
Newbie Poster
satija_tarun is offline Offline
1 posts
since Jul 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: java code to connect printer
Next Thread in Java Forum Timeline: Creating an array bubble sort





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC