• 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

need to fix" noClssDefFoundError"

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
anyone can let me know how do I fix this error when I run this.batch file to run my own class.



e.g batch file
set VertexSampleProg=IBCJF510TaxAreaLookup

:check_VertexSampleProg:
if not "%VertexSampleProg%"=="" goto RUN_PROG
set VertexSampleProg=IBCJF510TaxAreaLookup

:RUN_PROG:

echo Running Sample: %VertexSampleProg%

java -DVertexRoot=.\config -Xmx512m -Xms128m -cp .\LIB %VertexSampleProg%


pause

goto one:

my j2sdk1.4.2_12 is in c:\j2sdk1.4.2_12\bin folder.

Please fix it for me.

thanks,
 
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
NoClassDefFoundError always means that your classpath is not correct.

You do have a "-cp" switch on the command line. What is in that directory? Does it contain a file IBCJF510TaxAreaLookup.class? If not, then where is your class file?
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please fix it for me.

We don't really do that here. we can help you learn to fix your own programs, however.

I am not a shell script person, so i'll ask this:

What happens when you just try and run the java program directly, i.e. without the shell script?
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would use an absolute pathname in the CLASSPATH instead of a relative one. Also be sure to include . in the CLASSPATH.
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot for reply quickly,

when I run, Exception erro java.lang.noClassDefFound....

\api\bin\ A.class
\lib\ *.jar but not class here

if i run on DOS COMMAND. C:>java AA
same error.

thanks,
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot for reply quickly,

when I run, Exception erro java.lang.noClassDefFound....

\api\bin\ A.class
\lib\ *.jar but not class here

if i run on DOS COMMAND. C:>java AA
same error.

thanks,
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jesper!
How do I fix,

A.class is \api\bin (run batch pgm here)
*.jar which imported in source is in \lib

directory,
\\vertex\api\bin
\\vertex\lib

please help. gettting a trouble.. i am not good knowledge about classpath to define at all.

thanks,
 
Jesper de Jong
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

Originally posted by Paul Maeng:
Jesper!
How do I fix, ... i am not good knowledge about classpath to define at all.



Read the JDK documentation, look at this: How to set the classpath, How Classes are Found.
 
You didn't tell me he was so big. Unlike this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic