py5_tools.add_classpath()#

Add a Java jar file to the classpath.

Examples#

1import py5_tools
2
3py5_tools.add_jars('path/to/project_jars')
4py5_tools.add_classpath('path/to/jar/file/java_code.jar')
5
6import py5
7
8py5.println(py5_tools.get_classpath())

Description#

Add a Java jar file to the classpath. The path to the file can be absolute or relative.

After the JVM has started, the classpath cannot be changed. This function will throw a RuntimeError if it is called after the JVM has already started. Use py5_tools.is_jvm_running() to first determine if the JVM is running.

Syntax#

add_classpath(classpath: Union[Path, str]) -> None

Parameters#

  • classpath: Union[Path, str] - path to Java jar file

Updated on September 11, 2021 16:51:34pm UTC