Revision [1361]

This is an old revision of CommandJCall made by DavidLee on 2010-05-08 08:13:05.

 

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.


Options

-cp,-classpath classpathUses the specified classpath in the classloader for calling the specified class.
The classpath is expected to be a single string or sequence of strings.



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).

Notes on classpath

If the classpath is more then one string it should be in a sequence variable or expression.
To pass this expression as a sequence you need to wrap it with {} to keep it from being expanded into seperate arguments.




Examples


Example
cp=(lib/*.jar)
jcall -cp {$cp} org.test.MyClass arg1 arg2 arg3







CategoryCommands
Commands

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki