aspose file tools*
The moose likes Beginning Java and the fly likes Elementary Batch file  question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Elementary Batch file  question" Watch "Elementary Batch file  question" New topic
Author

Elementary Batch file question

steve dowdall
Ranch Hand

Joined: May 23, 2001
Posts: 36
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

Joined: Jul 10, 2001
Posts: 107
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

Joined: May 23, 2001
Posts: 36
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

Joined: Jul 10, 2001
Posts: 107

java -classpath the_path_to_the_package com.company.document

hope this helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Elementary Batch file question
 
Similar Threads
Running batch file from JSP
How to run bat file from Java program
How to run dos batch file from java program
NoClassDefFoundError when running a java app from outside it's folder
How to Run a batch file???