sudo apt install default-jre
java --version
sudo apt install default-jdk
javac -version
first determine where java installed :
Sudo update-alternatives --config java
sudo vi /etc/enviroment
insert this :
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" (The Address of java config result )
source /etc/enviroment
echo $JAVA_HOME
add the Repository key to system :
wget -q -O https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins
sudo systemctl start jenkins
sudo systemctl enable jenkins
sudo ufw enable
sudo ufw allow OpenSSH
sudo ufw allow 8080
sudo ufw status
check your browser in address http://ip:8080
for see login password : sudo cat /var/lib/jenkins/secrets/initialAdminPassword
then select install sugested plugin
make admin user