This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Elementary Batch file question  RSS feed

 
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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!