• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NoClassDefFoundError

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi:
I have a build file that compiles 2 .java classes(--compile task) and executes the class with the main() method(--execute task).
I get the following error in the execute task.
[java]java.lang.NoClassDefFoundError: WrapperTest (wrong name src/WrapperTest)
How can I rectify this? I am attaching the build.xml
-----------------------------------------------------------------------
<project default="execute">
<target name="init">
<!-- set global properties for this build -->
<property name="src" location="./src"/>
<property name="build" location="./build"/>
<property name="build.path" location="./build/src"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}" />
</target>
<target name="execute" depends="compile">
<java classname="WrapperTest">
<classpath>
<pathelement path="${build.path}"/>
</classpath>
</java>
<echo message="${build.path}"/>
</target>
</project>
---------------------------------------------------------------------
Thanks in advance.
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do u have any package declared, try giving the pull package name + class name.
 
reply
    Bookmark Topic Watch Topic
  • New Topic