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


Options to the Java virtual machine


Sometimes when you call up a Java application you need to pass parameters not to the program, but to the Java Virtual machine. The format for this is generally

java  -X... -D... classname, application parameters


the -X and -D parameters are not available to the jcall command. If that is what you need, use the java command, i.e. call out to the operating system, see BasicUsage



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