Share This Post:

Run Program unrecognized option

I am have a “Run Program” Action set up in a Prompt Element that encounters errors no matter which way I set it up

in the Gateway output.log, I can see where the command is set perfectly, but it is then followed by an error :

Could not create the Java virtual machine

This program works correctly when executed from a command line, or from a .bat file using the same exact command syntax

Run Program: java.exe -classpath C:\\JavaSQL\\sqljdbc_1.2\\enu\\sqljdbc.jar;c:\\javatc\\punch_in voicent.timecardin.MyDbPunchIN 4636012

Could not create the Java virtual machine.
Unrecognized option: -classpath C:\\JavaSQL\\sqljdbc_1.2\\enu\\sqljdbc.jar;c:\\javatc\\punch_in voicent.timecardin.MyDbPunchIN

I looked at the information on your web site and confirmed I entered everything as documented.

The Run Program fields I set up are
Program: java.exe
with 2 Arguments
‘-classpath C:\\JavaSQL\\sqljdbc_1.2\\enu\\sqljdbc.jar;c:\\javatc\\punch_in voicent.timecardin.MyDbPunchIN\’
account_number (passed as a variable)

What do I need to do differently in IVR Studio to make this work. As I mentioned above, it works fine from a command prompt and a .bat file, but not from Studio

The program arguments are prepared in a array and sent to Runtime.exec for execution, so you need to setup 4 arguments in the action.

‘-classpath’
‘C:\\JavaSQL\\sqljdbc_1.2\\enu\\sqljdbc.jar;c:\\javatc\\punch_in’
‘voicent.timecardin.MyDbPunchIN’
account_number

I changed it to 4 arguments and it still didn’t work. there is one difference in the error, besides the original “Java virtual machine” error, it’s also logging “Unrecognized option” here’s the 4 lines from the log file after making the change you suggested

Run Program: java.exe -classpath
C:\JavaSQL\sqljdbc_1.2\enu\sqljdbc.jar;c:\javatc\punch_in
voicent.timecardin.MyDbPunchIN 4636012

Could not create the Java virtual machine.
Unrecognized option: -classpath C:\JavaSQL\sqljdbc_1.2\enu\sqljdbc.jar;c:\javatc\punch_in

the text from “”Run Program:” is perfect and works from the command prompt

I also tried several variations of breaking up the arguments and those didn’t work either.

It should work. We tried to run ‘java.exe -version’.

Here is what we entered in the action:

Program: java.exe

args:

‘-classpath’
‘C:\\Program Files\\Voicent\\Gateway\\lib\\ant.jar’
‘-version’

Please make sure your have double backslashes.

The jar is not used. But the program runs from the gateway and shows the following in the log files:

Exec form item: runjava

Run Program: java.exe -classpath C:\\Program Files\\Voicent\\Gateway\\lib\\ant.jar -version

FLUSH
java version “1.6.0_07″
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

IT WORKS !!!!!!!!!!!!!!!
doubling up the backslashes did the trick !

Share This Post:

This entry was posted in IVR Usage. Bookmark the permalink.