install_java


"/home/yossef/notes/git/scripts/install_java.md"

path: git/scripts/install_java.md

- **fileName**: install_java
- **Created on**: 2025-03-26 14:51:57

install java for minecrift ;)

#!/usr/bin/env bash
_insatll() {
    ## check for java is install or not
    if _commend_exists java; then
        cecho "java found and install" blue
        exit 1
    fi
    cecho "starting install java" green
    ## starting install java
    sudo apt install default-jre
    if [[ $? != 0 ]]; then # check if there an error
        cecho "error happend in install java" red
        exit 1
    fi
    # starting downlaod javac
    cecho "starting installing javac" green
    sudo apt install default-jdk
    if [[ $? != 0 ]]; then # check if there an error
        cecho "error happend in install javac" red
        exit 1
    fi
    cecho "finsih isntalling java and javac"
}
_insatll

references