Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

bat file calling a .jar file

807605Jul 31 2007 — edited Jul 31 2007
Hi,

I'm getting an error when trying to invoke a .jar file from my Windows batch (.bat) file.

I get the following:
C:\j2sdk1.4.0\bin>java "Batch45Day.jar" BatchStandalone
Exception in thread "main" java.lang.NoClassDefFoundError: Batch45Day/jar
my question is - why I would get an error calling a .jar file that contains a class file that, when run by itself in the bat file, runs perfectly fine.

In other words, if I strip out the jar ref in the .bat file and only call the BatchStandalone class, it will run fine. Isn't it in essence the same thing?

If you're wondering why I wouldn't just run the class file itself within the batch file, I will, but ultimately I'm trying to get a class file to invoke a servlet, and I was under the impression that that could not be done, except bundled within a .jar file.

In other words, I need to have a scheduler (batch file) call a servlet to invoke a JSP, that will email someone a report daily.

Am I off the path here with this approach?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2007
Added on Jul 31 2007
8 comments
2,415 views