append_javaclass_path
append_javaclass_path(dir[, prepend])
This function appends the directory dir to the set javaclasspath option if not already present. If the optional argument prepend is specified and non-zero, dir is added to the beginning of the path list, removing any later occurrence of the directory. If prepend is zero or omitted and if dir is already present in the path list, the path list is returned.
Arbortext Editor has an embedded Java Virtual Machine that uses this directory list to search for Java classes when a Java method is called. Arbortext Editor automatically searches the distributed JAR files in the Arbortext-path/lib/classes directory.
|
Don't place custom JAR files in Arbortext-path\lib\classes. They will be ignored.
|
Note that any specification for Java class path is only evaluated when the first java_type function is called in a Arbortext Editor session. Subsequent changes to the path will not affect the running Java Virtual Machine until you exit Arbortext Editor and start a new session. Consequently, when using the java_type functions, you should call the append_javaclass_path function before invoking a java_type function.
Examples
If you wanted to append your directory for your Java class files stored in the /company/javaclass subdirectory, where your Java class directory would be searched last:
append_javaclass_path("/company/javaclass")
If you wanted to prepend your directory for your Java class files stored in the /company/javaclass subdirectory, where your Java class directory would be searched first:
append_javaclass_path('/company/javaclass',1)
If there is an Arbortext-path\custom\classes subdirectory at startup containing any JAR files (.jar), the path for each .jar file is automatically prepended to the Java class path for Arbortext Editor. Then the \custom\classes path is prepended, which automatically includes any compiled Java .class files in it. Putting your .class and .jar files in the \custom\classes subdirectory makes them automatically available, avoiding manual steps to add them to the path.
Related Topics