Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Elementary Batch file question

 
steve dowdall
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Why when I run my batch file do I get this error: Exception in thread "main" java.lang.NoClassDefFoundError: DocumentClient
I type it in DOS from the directory where it is and it still does not work. Yes, there is a main method and I can run it from within Forte just fine.
the batch file looks like this:
java DocumentClient

thanks,
Steve
 
Rikard Qvarforth
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i got your question right..
you could add the -classpath parameter to the bat file
ex java -classpath c:\whatever yourclassfile
Hope it helps
Rille

 
steve dowdall
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if my class file called DocumentClient is in a package like this:
package com.company.document
how do I set the classpath and call it from a batch file?
Steve
 
Rikard Qvarforth
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

java -classpath the_path_to_the_package com.company.document

hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic