.JavaAttachClassPath
Access External Java Classes

Description

Add Java class files and jar files to the Java classpath.

Usage

.JavaAttachClassPath(paths)

Arguments

paths A vector of strings containing one or more file names. Each file name can be either a Java .jar file or a directory containing java class files. These are added to the Java classpath, which is searched to find classes by .JavaMethod and .JavaCall. If this argument is missing, no values are added to the Java classpath.

Details

The .JavaAttachClassPath function loads additional Java classes to the Java class path while terrJava is running. Once they have been loaded, .JavaMethod and .JavaCall can be used to access these classes.
If .JavaAttachClassPath is given a directory, it should be the root directory of the full class path, rather than the directory that actually contains the class file itself. For example, if you are loading a class "com/abc/MyClass" with a compiled class file "/opt/myname/classes/com/abc/MyClass.class", you should specify the path as "/opt/myname/classes" rather than "/opt/myname/classes/com/abc".
Value
returns (invisibly) a vector of all the file names ever added with this function.
See Also
.JavaMethod, .JavaCall
Examples
## get all filenames ever attached
print(.JavaAttachClassPath())

## Not run: ## add a directory containing Java object files .JavaAttachClassPath("c:/java/bin/")

## add a jar file .JavaAttachClassPath("c:/myobjects.jar") ## End(Not run)

Package terrJava version 6.0.0-69
Package Index