Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

need to fix" noClssDefFoundError"  RSS feed

 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • 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,
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • 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?
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!