Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-31-2009, 06:00 PM
RodrigoReboucas RodrigoReboucas is online now
Registered User
 
Join Date: 07-15-2009
Posts: 12
How to execute Java Batch File

I am trying to execute a Batch file through the "BatchFile" Action/Step and I get the following error:

java.lang.NoClassDefFoundError: fitnesse/FitNesse
Caused by: java.lang.ClassNotFoundException: fitnesse.FitNesse
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: fitnesse.FitNesse. Program will exit.
Exception in thread "main" Press any key to continue . . .

The Batch file uses the java runtime and works great from Windows Explorer but apparently I have to initialize the RT from inside VBP. This is my batch file content:


java -cp fitnesse.jar fitnesse.FitNesse -p 8089 %1 %2 %3 %4 %5
pause

Any thoughts on how to accomplish that?

Thanks,
Rodrigo
Reply With Quote
  #2  
Old 08-31-2009, 06:25 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
That should work. You may need to specify a 'Start in' path of the location of the .bat file (since no path is specified for the .jar file in the batch file). If that doesn't help, I would suspect some sort of problem with an environment variable needed by java (launching VBP from the same Explorer where the batch file works should cause VBP to inherit the same environment block). You could also call java directly from a Run Program action (since the batch file contains only one command other than a pause statement, which you probably don't want in an automated build anyway).
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 10:36 AM.


Copyright © 1999-2023 Kinook Software, Inc.