• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

Exception in thread "main" java.lang.NoClassDefFoundError

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting the following error , does anyone know what i am doing wrong

 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rajesh Khan,

Always, SearchFirst. NoClassDefFoundError is very common error.

Have you put your Test class inside any package (exmple25)? In that case, you need to run it accordingly.

I hope this helps.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like the class Test is in the package example25.

What you should do is put the base directory of the package in the classpath, and specify the fully-qualified name of the class. For example, if C:\jibx\tutorial is the base directory, try a command like this:

java -cp C:\jibx\tutorial example25.Test
 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here what i tried. Unfortunately its not working
C:\jibx>java -cp C:\jibx\tutorial example25.Test
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Now the same exception is occurring for a class org.jibx.runtime.JiBx.

Does that class exist in C:\jibx\tutorial directory in the same structure? That is, there must be a file named C:\jibx\tutorial\org\jibx\runtime\JiBx.class

If this structure (org.jibx.runtime.JiBx) is inside a jar file, then you have to give name of that jar file as well in classpath.

I hope this helps.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic