Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

NoClassDefFoundError in eclipse

Posted on 2005-04-19
14
Medium Priority
?
1,550 Views
Last Modified: 2013-11-18
i make a new java project in eclipse from external folder
every thing is nice
but when i configure the run to the main class
it shows this execption NoClassDefFoundError
it is really amazing,everyt thing seems OK,why it didnt find the class
thank u for ur help
0
Comment
Question by:laes_
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13815942
You're missing some classes/jars on the classpath

add it to the project. Right click the project/java compiler/build path/add jar
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13816005
more acurately:

[Right click your project]/properties/Java Build Path/Libraries Tab/Add JARS or Add External JARS
0
 
LVL 10

Expert Comment

by:edwardiii
ID: 13816085
Hi, laes.

How did you set up a new project in Eclipse?  Please list the exact steps you took, and list the complete name of your java file, where it is on your hard drive, what package it is in, and the literal syntax you used to try to compile it.  
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Expert Comment

by:cakirfatih
ID: 13817100
Eclipse uses Plugins, are u doing anything in your code that requires Plugins ? visit the web site for the list of plug-ins.
good luck.
0
 
LVL 2

Author Comment

by:laes_
ID: 13817383
hi,thyank u for ur comment
>>more acurately:
file ->new->project->java project->i put the project's name and  create projet at external location ,i browse to the worspace containing the folder->i added required jar file .
.

0
 
LVL 10

Expert Comment

by:edwardiii
ID: 13818237
Ok, if you're creating a jar, follow the steps listed in the "Accepted" answer here: http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21279937.html 

Follow the steps, and let us know your results.
0
 
LVL 2

Author Comment

by:laes_
ID: 13822583
no i 'm not creating a jar file,all jar file are ready
my problem is that i define a new project based on exetrnal folder
when i call the main class,it raises an execption,despite of the fact that the class exists !,
NoClassDefFoundError
0
 
LVL 2

Author Comment

by:laes_
ID: 13825901
suppose that i have one folder conatining all packaeges and classes
i want to make a new project based on this folder
so what i must do more than
file ->new->project->java project->i put the project's name and  create projet at external location ,i browse to the worspace containing the folder->i added required jar file .
that is my question
0
 
LVL 10

Expert Comment

by:edwardiii
ID: 13826136
I'm guessing your issue is the Jar you create doesn't work.  Apparently you've already followed bloodredsun's advice and/or you've done what you detailed above (e.g. "create project at external location"), and you can run your class file within Eclipse, is that right?  If so, the problem to decipher is why you can't create a workable Jar.  If that is the case, can you list verbatim the steps you took to create your Jar (feel free to reference the post I noted previously).  If that is not the case, please tell us where you're running into a wall with Eclipse and what errors/results you're getting.
0
 
LVL 2

Author Comment

by:laes_
ID: 13826260
if i have a folder containing all that classes into subfolder(package)
and i follow that steps ,create project at external location...
 (the jar file that i posted in the previous comment are those that classes needed
not a jar file witch result from archiving the folder containing all classes)
i want to know what i must do in addition to this?
>>what errors
the exception that it raises is:
Exception in thread "main" java.lang.NoClassDefFounfError : <path of the main class>
0
 
LVL 10

Accepted Solution

by:
edwardiii earned 120 total points
ID: 13827498
Sounds like you're referencing an external Jar in your Eclipse-built Jar file.  Your Eclipse-built class works fine in the Eclipse IDE, but when you click on the Jar it created it can't find the external Jar?  Maybe this page will help:

     http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=12&t=002932

Or:

     http://www.cs.laurentian.ca/badams/c1047/eclipse-tutorials/external-jar-tutorial.html
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question