Skip to main content

Questions tagged [noclassdeffounderror]

The Java Error thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and a valid representation of the class could not be constructed.

noclassdeffounderror
Filter by
Sorted by
Tagged with
679 votes
33 answers
1.2m views

Why am I getting a NoClassDefFoundError in Java?

I am getting a NoClassDefFoundError when I run my Java application. What is typically the cause of this?
John Meagher's user avatar
  • 23.9k
390 votes
15 answers
191k views

What causes and what are the differences between NoClassDefFoundError and ClassNotFoundException?

What is the difference between NoClassDefFoundError and ClassNotFoundException? What causes them to be thrown? How can they be resolved? I often encounter these throwables when modifying existing ...
krisp's user avatar
  • 4,777
306 votes
34 answers
1.8m views

How can I solve "java.lang.NoClassDefFoundError"?

I've tried both the examples in Oracle's Java Tutorials. They both compile fine, but at run time, both come up with this error: Exception in thread "main" java.lang.NoClassDefFoundError: ...
Jonathan Lam's user avatar
  • 17.3k
232 votes
10 answers
652k views

java.lang.NoClassDefFoundError: Could not initialize class XXX

public class PropHolder { public static Properties prop; static { //code for loading properties from file } } // Referencing the class somewhere else: Properties prop = PropHolder.prop; ...
Leon's user avatar
  • 8,371
218 votes
26 answers
630k views

Getting java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory exception

i am executing simple Dependency Injection program of spring & getting this exception. I have already included common-logging1.1.1.jar and spring.jar file. Could you please help to out? ...
user avatar
131 votes
21 answers
180k views

java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing

While running junit test in eclipse I am getting this Exception: java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing I've added junit.jar library file. I've tried different versions of ...
user2013948's user avatar
  • 1,311
102 votes
16 answers
347k views

java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonFactory

I am working on YouTube broadcast sample examples. I have created a sample Java Project & added required jars. But, when I try to run the project it throws exception. Exception : Throwable: com/...
VVB's user avatar
  • 7,551
96 votes
4 answers
11k views

java.lang.NoClassDefFoundError: android/graphics/drawable/Icon

So far I got this error only for one user, who uses a rooted phone (SM-G900R7 Android 4.4.2). The error is like this: Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/drawable/Icon ...
cn123h's user avatar
  • 2,332
93 votes
18 answers
213k views

java.lang.NoClassDefFoundError in junit

I am getting this error in java in my junit test code. I looked up on the net and it says that I need to add the junit.jar in the classpath. In Eclipse I have added it in the classpath of Project ...
user avatar
83 votes
30 answers
112k views

Unable instantiate android.gms.maps.MapFragment

I try to do a demo with google maps android v2 with very simple activity, just copy code from google page: https://developers.google.com/maps/documentation/android/start#...
mmm2006's user avatar
  • 1,247
78 votes
24 answers
115k views

NoClassDefFoundError for code in an Java library on Android

I am experiencing an error quite often among my users. The app crashes during startup. When the MainActivity is supposed to be loaded the VM apparently cannot find the class. I cannot figure out why. ...
kjoelbro's user avatar
  • 6,286
74 votes
8 answers
137k views

NoClassDefFoundError: wrong name

I wrote a java program to test RESTful web services by using Netbeans7.0.1 and it works fine there. Now I wrote the build.xml file to compile the code and when I try to run the generated .class file I ...
thinkBig's user avatar
  • 863
59 votes
21 answers
405k views

Exception in thread 'main' java.lang.NoClassDefFoundError:

The following program is throwing error: public class HelloWorld { public static void main(String args[]) { System.out.println("Hello World!"); } } CLASSPATH C:\Program Files\Java\...
Haritha's user avatar
  • 631
54 votes
8 answers
116k views

Android java.lang.NoClassDefFoundError

I have an Android project in eclipse IDE which was working. After some imports and tests, I get the error: java.lang.NoClassDefFoundError. In my project I have two packages: the main one and the ...
Milos Cuculovic's user avatar
48 votes
5 answers
86k views

Java ClassNotFoundException with maven dependency

I am getting ClassNotFoundException and NoClassDefFoundError exceptions when I attempt to run my application using a maven defined dependency. I added my maven dependency for the jar in question to ...
Vex's user avatar
  • 1,209
46 votes
5 answers
62k views

NoClassDefFoundError JsonAutoDetect while parsing JSON object

I am developing a webapp using Amazon's cloud services and I need to make use of JSON objects. How my project is set up is, I have an HTML form where the user will fill in their information and submit....
jhahn's user avatar
  • 461
43 votes
10 answers
20k views

Gson NoClassDefFoundError after ADT and SDK Tools update to v17

Today I updated my ADT and SDK Tools to v17 and my projects using Google's gson jar library started to throw NoClassDefFoundError. Here's the logcat output: > 03-22 12:30:58.941: E/AndroidRuntime(...
Yasin YILDIRIM's user avatar
43 votes
5 answers
48k views

how to export a executable jar in gradle, and this jar can run as it include reference libraries

how to export a executable jar in gradle, and this jar can run as it include reference libraries. build.gradle apply plugin: 'java' manifest.mainAttributes("Main-Class" : "com.botwave.analysis....
jychan's user avatar
  • 1,001
41 votes
5 answers
185k views

java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

I have actually figured this problem out, but it took me days, so I thought I would paste my solution here to aide others. I am using Fedora 11, and in Eclipse I tried adding a Tomcat 6 server and ...
Sean R's user avatar
  • 1,519
41 votes
9 answers
83k views

java.lang.NoClassDefFoundError: javax/el/ELManager

I'm working on a webapp in Spring using Spring Tool Suite. If I build and deploy the application there using the IDE onto the provided Pivotal tc Server, it works just fine. However, if I do a manual "...
J_S's user avatar
  • 3,172
41 votes
4 answers
27k views

Why NoClassDefFoundError caused by static field initialization failure?

Here is a interesting java question. the following simple java program contains static field initialized by a method statically. Actually, I force the method which calculate the intiailize value to ...
ext2's user avatar
  • 411
40 votes
2 answers
76k views

Tomcat 10.x throws java.lang.NoClassDefFoundError on javax.servlet.* [duplicate]

Deployed servlet based web application at context path [/VirtualStore], but context failed to start with below log. 19-Mar-2021 11:46:35.075 INFO [main] org.apache.catalina.startup.HostConfig....
Girbson BIJOU's user avatar
38 votes
12 answers
151k views

JavaFX Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application

I'm getting this error Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Ap plication at java.lang.ClassLoader.defineClass1(Native Method) at java.lang....
Archey's user avatar
  • 1,342
37 votes
9 answers
36k views

ClassNotFoundException vs NoClassDefFoundError

I have gone through this thread What causes and what are the differences between NoClassDefFoundError and ClassNotFoundException? This is what one of the ans,which has max ups, in thread is : ...
Deen John's user avatar
  • 3,650
34 votes
13 answers
121k views

Spring Boot ClassNotFoundException org.springframework.core.metrics.ApplicationStartup

I am currently playing with some proof-of-concept work in Spring Boot and GCP data storage. My pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>...
el n00b's user avatar
  • 1,817
31 votes
2 answers
51k views

Why do I get `java.lang.NoClassDefFoundError: scala/Function1` when I run my code in ScalaIDE?

Here is a simple test I'm using to invoke a Scala method from Java: public static void main(String args[]) { java.util.Map<String, java.util.List<String>> rec = news.recommend.DriverObj....
blue-sky's user avatar
  • 53.3k
26 votes
10 answers
18k views

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string;

I tried out many things, but it does not solve my problem. Full Error Code (kompletter Error Code): 05-16 09:59:53.428 25010-25010/main.faseflex.de.fgnapp E/AndroidRuntime: FATAL EXCEPTION: main ...
Dureox's user avatar
  • 279
26 votes
4 answers
100k views

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/ConditionalTagSupport

I am using sitemesh to decorate the pages. I am using a JSP page for this. The page worked fine until I used the <c:if> conditional tag. I have the jstl-impl-1.2.jar & sitemesh-3.0-alpha-1....
Ghost-Man's user avatar
  • 2,189
25 votes
7 answers
179k views

setting JAVA_HOME & CLASSPATH in CentOS 6

I have unpacked my jdk in /usr/java/. and I put CLASSPATH, PATH, JAVA_HOME into /etc/profile like below. export JAVA_HOME=/usr/java/jdk1.7.0_21 export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=$...
Juneyoung Oh's user avatar
  • 7,550
25 votes
3 answers
71k views

NoClassDefFoundError at Runtime with Gradle

I'm using gradle as the JavaFX plugin. Everything works perfectly even after building and runnig the excecutable at distribution/, except with one class: CloseableHttpClient For several purposes I ...
jntme's user avatar
  • 622
25 votes
2 answers
3k views

NoClassDefFoundError: android.app.ANRManagerProxy

Does anyone know why this happens? I see this crash reported by my app but I have no idea what it is. java.lang.NoClassDefFoundError: android.app.ANRManagerProxy Thread: Binder_3, Exception: java....
Alexander's user avatar
  • 48.1k
24 votes
3 answers
20k views

NoClassDefFoundError below SDK 21

I just experienced an awkward bug in my App. On my Nexus 5/7, running android 5.0.1/5.0.2, everything works just fine. However if i try running the exact same code on a device with an earlier version ...
user2700475's user avatar
23 votes
6 answers
8k views

Android - Google Maps API v2 - NoClassDefFoundError

I try to run Google Maps with Intellij IDEA 12. I already tried advices: Embedding google maps android v2 in android Google Maps Android API v2 Authorization failure Unable instantiate android.gms....
Londeren's user avatar
  • 3,292
21 votes
6 answers
43k views

Receiving "wrong name" NoClassDefFoundError when executing a Java program from the command-line

I have a problem while trying executing my java application. Whenever I try to execute the program through the command java ProgAudioJ I get this error: Exception in thread "main" java.lang....
MAX's user avatar
  • 231
21 votes
3 answers
59k views

Exception in thread "main" java.lang.NoClassDefFoundError: wrong name

My file directory: project/src/m2mcom/entities/AutomatedTelnetClient.java /web/Simple.java /org/apache/commons/net/telnet/TelnetClient.java The source code of the ...
vicesbur's user avatar
  • 333
20 votes
1 answer
6k views

NoClassDefFoundError for .jar library at runtime in Android Studio

Hi Friends at Stack Overflow I recently run into a problem when implementing Fiksu SDK in my Android app. A brief intro, Fiksu SDK is a marketing tool to register installation and events. All the ...
Shawn Lu's user avatar
  • 1,566
20 votes
2 answers
4k views

What could cause a sudden ClassNotFoundException in a long running process?

We have a very small Web service (less than 1K lines of code) which is run by Jetty. The service worked always fine even during our stress testing phase. However, after 13 days of uptime we ...
Sebastian's user avatar
  • 1,825
19 votes
8 answers
63k views

eclipse doesn't compile the project

I had running project opened in eclipse. After an accidental restart of windows, now when I open the eclipse I see my project is marked with a little red cross. Now when I run the main method I get a ...
samsamara's user avatar
  • 4,760
19 votes
1 answer
46k views

Adding Joda Time

I am building an app that uses time. I decided to use Joda time. I am trying to add joda time to my app. I have no experience with adding .jar files to the libs. I followed these steps(see bottom), or ...
Chad Bingham's user avatar
  • 33.5k
18 votes
6 answers
13k views

NoClassDefFondError in Android... but the Class is in one jar included in the Classpath

I am developing an App in Android. It has to be able of take a photo, and to send that photo to a webpage. This is the code: HttpClient httpclient = new DefaultHttpClient(); HttpPost ...
Fustigador's user avatar
  • 6,409
18 votes
5 answers
17k views

ClassNotFoundException:scala.PreDef$ issue

I am trying to package a simple executable Jar written in Scala, through Eclipse's Export function. When attempting to execute the Jar from cmd java -jar test2.jar I get the following error. Any ideas?...
Andy's user avatar
  • 1,193
17 votes
7 answers
61k views

Jetty throws NoClassDefFoundError: org/eclipse/jetty/util/FutureCallback on shutdown

Our maven build throws at the end of the build of the shutdown of jetty a NoClassDefFoundError that I do not understand. Does anyone have an idea where this is comming from and how to fix it? Here is ...
Johannes Pfeifer's user avatar
17 votes
2 answers
22k views

Java Mail Issue with Session.getInstance

I am receiving the following exception when trying to use java mail; java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger at javax.mail.Session.initLogger(Session.java:226) at javax....
Biscuit128's user avatar
  • 5,338
17 votes
2 answers
27k views

ERROR : java.lang.NoClassDefFoundError: android.support.v4.content.LocalBroadcastManager [duplicate]

I have gone through all the related threads about his error but i was not successful . App was working fine and i found some updates on SDKs yesterday . I Updated by Android SDK Tools to 22(Rev.) ...
VIGNESH's user avatar
  • 2,033
17 votes
7 answers
12k views

kafka NoClassDefFoundError kafka/Kafka

Regarding Apache-Kafka messaging queue. I have downloaded Apache Kafka from the Kafka download page. I've extracted it to /opt/apache/installed/kafka-0.7.0-incubating-src. The quickstart page says ...
summerbulb's user avatar
  • 5,789
17 votes
7 answers
36k views

java.lang.NoClassDefFoundError: org/apache/spark/streaming/twitter/TwitterUtils$ while running TwitterPopularTags

I am a beginner in Spark streaming and Scala. For a project requirement I was trying to run TwitterPopularTags example present in github. As SBT assembly was not working for me and I was not familiar ...
vpv's user avatar
  • 339
16 votes
2 answers
93k views

java.lang.NoClassDefFoundError: org/springframework/beans/factory/NoUniqueBeanDefinitionException

I am trying to create a simple project using Spring MVC+JPA Hibernate+maven. My web.xml is as follows <servlet> <servlet-name>ContactManager</servlet-name> <servlet-class&...
Sandhya's user avatar
  • 209
15 votes
2 answers
26k views

Apache Flink: java.lang.NoClassDefFoundError

I'm trying to follow this example but when I try to compile it, I have this error: Error: Unable to initialize main class com.amazonaws.services.kinesisanalytics.aws Caused by: java.lang....
IoT user's user avatar
  • 1,272
15 votes
6 answers
4k views

NoClassDefFoundError on Calligraphy library

After adding compile 'com.android.support:support-v13:21.0.+' to build.gradle, I had some conflicts on building my app, so I had to add multiDexEnabled = true to defaultConfig inside build.gradle. ...
Arash GM's user avatar
  • 10.4k
15 votes
2 answers
45k views

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

I am developing an application for FB Login with website using Javascript and JSF. I have posted my code at here. The problem is, when I run my application it does't show the JSF page, it instead ...
Wanna Coffee's user avatar
  • 2,760

1
2 3 4 5
45