Exemplo n.º 1
0
def search_jdk():
    for file in os.listdir():
        if "jdk" in file and not os.path.isfile(os.path.join(".", file)):
            utils.set_java_home(file)
            return True
    jdk = os.environ.get("JAVA_HOME")
    # why tf your jdk points to recycle bin bitch are you retarted
    return jdk is not None and utils.verify_path(jdk)
Exemplo n.º 2
0
 def __init__(self, sernaDoc, properties):
     DocumentPlugin.__init__(self, sernaDoc, properties)
     self.buildPluginExecutors(True)
     pp = self.pluginProperties()
     self._pluginDir = unicode(pp.getProperty("resolved-path").getString())
     self._dialog = None
     config_root = SernaConfig.root()
     java_home = config_root.getProperty("vars/java_home").getString()
     set_java_home(unicode(java_home))
Exemplo n.º 3
0
def download_jdk():
    if not search_jdk() or settings["force_install_jdk"]:
        jdk_link = settings["jdk_link_x64"] if utils.is_x64(
        ) else settings["jdk_link_x86"]
        jdk_zip_name = settings["jdk_zip_name"]
        utils.download_file_and_extract(jdk_link, jdk_zip_name)
        os.rename("jdk-14.0.2+12",
                  "jdk-14.0.2") if os.path.exists("jdk-14.0.2+12") else None
        # Set JAVA_HOME and PATH
        utils.set_java_home("jdk-14.0.2")
        os.environ["PATH"] = os.environ["PATH"] + ";" + os.path.join(
            os.environ["JAVA_HOME"], "bin")
Exemplo n.º 4
0
def search_jdk():
    if jdk_zip_exists():
        locales.adv_print(f"JDK_ZIP_ALREADY_EXISTS",
                          variables={"zipfile": settings["jdk_zip_name"]})
        utils.extract_file(settings["jdk_zip_name"])
        os.remove(settings["jdk_zip_name"])
    for file in os.listdir():
        if "jdk" in file and not os.path.isfile(os.path.join(".", file)):
            utils.set_java_home(file)
            return True
    jdk = os.environ.get("JAVA_HOME")
    # why tf your jdk points to recycle bin bitch are you retarted
    return settings["skip_jdk_checks"] or (jdk is not None
                                           and utils.verify_path(Path(jdk)))
Exemplo n.º 5
0
def search_jdk():
    if jdk_zip_exists():
        locales.adv_print(f"JDK_ZIP_ALREADY_EXISTS", variables={"zipfile": settings["jdk_zip_name"]})
        utils.extract_file(settings["jdk_zip_name"])
        os.remove(settings["jdk_zip_name"])
    for file in os.listdir():
        jdk_path = os.path.join(os.getcwd(), file)
        if "jdk" in file and not os.path.isfile(jdk_path) and utils.verify_path(Path(jdk_path)):
            extend_path(jdk_path)
            return True
    p = utils._Path(settings["jdk_installation_path"])
    for file in p.listdir():
        jdk_path = os.path.join(p.value, file)
        if "jdk" in file and os.path.isdir(jdk_path) and utils.verify_path(Path(jdk_path)):
            extend_path(os.path.join(p.value, file))
            utils.set_java_home(os.path.join(p.value, file))
            return True
    jdk = os.environ.get("JAVA_HOME")
    return settings["skip_jdk_checks"] or (jdk is not None and utils.verify_path(Path(jdk)))
Exemplo n.º 6
0
def extend_path():
    utils.set_java_home("jdk-14.0.2")
    os.environ["PATH"] = os.environ["PATH"] + ";" + os.path.join(
        os.environ["JAVA_HOME"], "bin")
Exemplo n.º 7
0
def extend_path(pov):
    utils.set_java_home(pov)
    os.environ["PATH"] = os.environ["PATH"] + ";" + os.path.join(os.environ["JAVA_HOME"], "bin")