473,569 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

java.lang.NoCla ssDefFoundError

38 New Member
Hi Bytes,

i run the sample java code(BarChartDe mo.java)which is producing the Bar charts as output if no error in the program, but i got run time error like this,

java.lang.NoCla ssDefFoundError : BarChartDemo (wrong name: org/jfree/chart/demo/BarChartDemo)
at java.lang.Class Loader.defineCl ass1(Native Method)
at java.lang.Class Loader.defineCl ass(Unknown Source)
at java.security.S ecureClassLoade r.defineClass(U nknown Source)
at sun.plugin2.app let.Applet2Clas sLoader.findCla ss(Unknown Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.plugin2.app let.Plugin2Clas sLoader.loadCod e(Unknown Source)
at sun.plugin2.app let.Plugin2Mana ger.createApple t(Unknown Source)
at sun.plugin2.app let.Plugin2Mana ger$AppletExecu tionRunnable.ru n(Unknown Source)
at java.lang.Threa d.run(Unknown Source)
Exception: java.lang.NoCla ssDefFoundError : BarChartDemo (wrong name: org/jfree/chart/demo/BarChartDemo)

Please suggest me something about this problem.
Apr 17 '09 #1
4 5105
r035198x
13,262 MVP
In what package is that class(what package declaration does it have?). It's package must also match the folder structure in which you have put it.
Apr 17 '09 #2
JosAH
11,448 Recognized Expert MVP
@xtremebass
Carefully check the name of your class and the name of the file in which it is stored. Also check if the path to that file matches the package structure.

The error message says it all: the name of the class and the file don't match; the classloader did find something but the names don't match.

kind regards,

Jos
Apr 17 '09 #3
devgupta01
20 New Member
if you cange the file name as class name then it will run..
Apr 28 '09 #4
pjerald
77 New Member
check the CLASSPATH variable. you can find it easily by ,


use this for windows -
echo %CLASSPATH%
use this for linux -
echo $CLASSPATH
May 1 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

11
167078
by: Lem | last post by:
I get the error Exception in thread "main" java.lang.NoClassDefFoundError when I type java app2 in the command prompt. I've tried moving to the jre directory and typed java c:\app2\app2, but it gives me the same exception. What could be the problem? Thanks in advance, Lem
0
4489
by: Shawn | last post by:
I am getting the following error with a Java Applet being served out by IIS over HTTPS/SSL using a Verisign certificate: java.lang.NoClassDefFoundError: javax/help/HelpSetException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590) at...
2
3072
by: Stefano Bianchi | last post by:
Ciao, I need to start a java form compiler from linux. The script that comes with the program simply says (after some checks): java -classpath Packager.jar:Filler.jar -jar EPT.jar However, if I run it, I get:
1
6908
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
13
4433
by: Ash | last post by:
Hey. Im new to Java, and am having a prroblem with the netbeans IDE. every time i try to import java.awt.* , I can't use any of the methods(like they don't exist). I can compile it fine, but when I try to run it, I get "exception in class main". Can anyone help me, please?
1
47602
by: greg.knaddison | last post by:
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is:
2
1733
by: sandhu236 | last post by:
hi all, I am facing problem while trying run the java .exe through the batch file created on linux platform ,I have set the class path in the bash also ...but still it is giving no class found exception(java.lang.NoClassDefFoundError " Iam geeting the following error Exception in thread "main" java.lang.NoClassDefFoundError:...
0
3676
by: HiteshMehra | last post by:
Hi all, I am getting an error while trying to connect to the MQ. The error is java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:68) at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:493) at...
5
2720
by: Ananthu | last post by:
Hi I have done all the codings part for connecting mysql server with java application but when i try to compile,the compilation is successful and during execution i get the following message, Exception in thread "main" java.lang.NoClassDefFoundError: MysqlConnect Coding Part: import java.sql.*; import java.lang.*;
4
14707
by: jmitch89 | last post by:
I don't why I get this error: Exception in thread "main" java.lang.NoClassDefFoundError The statement below works just fine: java -cp "appframework-1.0.3.jar;swing-worker-1.1.jar";CurrentStrobe.jar com.visionpro.currentstrobe.CurrentStrobeApp However, the statement below produces the error: java -cp...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.