Exemplo n.º 1
0
def _try_to_verify_java_version():
    """
    Best effort check to make sure users have required Java version installed.
    """
    java_path = get_java_path()
    try:
        java_version = _get_java_version(java_path)
        if java_version and java_version != REQUIRED_JAVA_VERSION:
            _warn_about_wrong_java_version(REQUIRED_JAVA_VERSION, java_version)
    except:
        # checking Java version is brittle and as such is best effort
        logging.warning("Cannot verify that installed Java version at '{}' \
is correct.".format(java_path))
Exemplo n.º 2
0
def _try_to_verify_java_version():
    """
    Best effort check to make sure users have required Java version installed.
    """
    java_path = get_java_path()
    try:
        java_version = _get_java_version(java_path)
        if java_version and java_version != REQUIRED_JAVA_VERSION:
            _warn_about_wrong_java_version(REQUIRED_JAVA_VERSION, java_version)
    except:
        # checking Java version is brittle and as such is best effort
        logging.warning("Cannot verify that installed Java version at '{}' \
is correct.".format(java_path))
Exemplo n.º 3
0
def _try_to_verify_java_version(java_version_status_queue):
    """
    Best effort check to make sure users have required Java version installed.
    """
    java_path = get_java_path()
    warning = None
    try:
        java_version = _get_java_version(java_path)
        if java_version and java_version != REQUIRED_JAVA_VERSION:
            warning = "You're using Java {}, but Buck requires Java {}.\nPlease follow \
https://buckbuild.com/setup/getting_started.html \
to properly setup your local environment and avoid build issues.".format(
                java_version, REQUIRED_JAVA_VERSION)

    except:
        # checking Java version is brittle and as such is best effort
        warning = "Cannot verify that installed Java version at '{}' \
is correct.".format(java_path)
    java_version_status_queue.put(warning)
Exemplo n.º 4
0
Arquivo: buck.py Projeto: shs96c/buck
def _try_to_verify_java_version(java_version_status_queue):
    """
    Best effort check to make sure users have required Java version installed.
    """
    java_path = get_java_path()
    warning = None
    try:
        java_version = _get_java_version(java_path)
        if java_version and java_version != REQUIRED_JAVA_VERSION:
            warning = "You're using Java {}, but Buck requires Java {}.\nPlease follow \
https://buckbuild.com/setup/getting_started.html \
to properly setup your local environment and avoid build issues.".format(
                java_version, REQUIRED_JAVA_VERSION
            )

    except:
        # checking Java version is brittle and as such is best effort
        warning = "Cannot verify that installed Java version at '{}' \
is correct.".format(
            java_path
        )
    java_version_status_queue.put(warning)
Exemplo n.º 5
0
 def test_with_java_home_valid(self):
     os.environ["JAVA_HOME"] = self.java_home
     self.assertEqual(
         get_java_path().lower(),
         os.path.join(self.java_home, "bin", self.java_exec).lower(),
     )
Exemplo n.º 6
0
 def test_without_java_home(self):
     self.assertEquals(get_java_path().lower(), which("java").lower())