Revision [779]
This is an old revision of CommandJCall made by DavidLee on 2009-09-16 07:59:40.
Command jcall
Name
jcall calls a java program (any class's static main)Synopsis
jcall [-cp|-classpath classpath ] classname [args]Description
Calls a java program from within the same JVM and thread as the current shell."classname" is the full package and class name, e.g. "org.xmlsh.commands.xpwd"
Args are optional arguments to be sent to called class.
-cp classpath
-classpath classpath Uses the specified classpath in the classloader for calling the specified class. The classpath is expected to be a single string or sequence of strings.l
This command simulates the equivilent call to "java" command line.
The class is attempted to be loaded, and the main function called with the supplied parameters.
Note, stdin and stdout are redirected to the shell's input and output, but stderr is not changed (remains the stderr of the calling environment, due to java limitations).
Example
$ cp=(lib/*.jar) $ jcall -cp $cp org.test.MyClass arg1 arg2 arg3
CategoryCommands