- Learning Continuous Integration with Jenkins(Second Edition)
- Nikhil Pathania
- 151字
- 2021-07-02 21:18:34
Installing Java
Follow these steps to install Java on Ubuntu:
- Update the package index:
sudo apt-get update
- Next, install Java. The following command will install the Java Runtime Environment (JRE):
sudo apt-get install default-jre
- To set the JAVA_HOME environment variable, get the Java installation location. Do this by executing the following command:
update-java-alternatives -l
- The previous command will print the list of Java applications installed on your machine along with their installation paths. Copy the Java path that appears on your Terminal:
java-1.8.0-openjdk-amd64 1081
/usr/lib/jvm/java-1.8.0-openjdk-amd64
- Open the /etc/environment file for editing using the following command:
sudo nano /etc/environment
- Add the Java path (the one that you copied earlier) inside the /etc/environment file in the following format:
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"
- Type Ctrl + X and choose Y to save and close the file.
- Next, reload the file using the following command:
sudo source /etc/environment
推薦閱讀
- pcDuino開發(fā)實戰(zhàn)
- Kubernetes修煉手冊
- Linux系統(tǒng)文件安全實戰(zhàn)全攻略
- 構(gòu)建高可用Linux服務(wù)器(第4版)
- Learning Windows Server Containers
- Ubuntu Linux操作系統(tǒng)
- 計算機系統(tǒng)開發(fā)與優(yōu)化實戰(zhàn)
- Windows Server 2019 Administration Fundamentals
- Learning Magento 2 Administration
- Linux服務(wù)器配置與管理
- 操作系統(tǒng)之哲學(xué)原理第2版
- Java EE 8 High Performance
- SAP后勤模塊實施攻略:SAP在生產(chǎn)、采購、銷售、物流中的應(yīng)用
- 樹莓派+傳感器:創(chuàng)建智能交互項目的實用方法、工具及最佳實踐
- Instant Responsive Web Design