py5_tools.add_classpath()

Add a Java jar file to the classpath.

Examples

1
2
3
4
5
6
7
8
import py5_tools

py5_tools.add_jars('path/to/project_jars')
py5_tools.add_classpath('path/to/jar/file/java_code.jar')

import py5

py5.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