The java::call command is used to invoke public static methods on Java classes from Tcl code. The class argument specifies the name of the declaring class of the method to invoke. The signature argument specifies which class method to invoke. Signatures are covered in the Signatures section.
Additional parameters to the java::call command are converted to Java objects or primitive Java types before being passed to the Java method. The Conversions section describes the result and possible error conditions of the java::call command, including the effect of the optional -noconvert flag.
# Call the method java.lang.Integer.toBinaryString(int)
set string [java::call Integer toBinaryString 5]
# This will print "result is 101", the binary representation of 5
puts "result is $string"
Copyright © 1997-1998 Sun Microsystems, Inc.