<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_variable(self, key, value, system_wide=False):
 """ Adds the environment variable. :param key: the name of the variable :type key: str :param value: the value :type value: str :param system_wide: whether to add the variable system wide :type system_wide: bool """

        if system_wide:
            javabridge.call(self.jobject, "addVariableSystemWide", "(Ljava/lang/String;Ljava/lang/String;)V", key, value)
        else:
            javabridge.call(self.jobject, "addVariable", "(Ljava/lang/String;Ljava/lang/String;)V", key, value)