官术网_书友最值得收藏!

Installing Java

Follow these steps to install Java on Ubuntu:

  1. Update the package index:
        sudo apt-get update
  1. Next, install Java. The following command will install the Java Runtime Environment (JRE):
        sudo apt-get install default-jre 
  1. To set the JAVA_HOME environment variable, get the Java installation location. Do this by executing the following command:
        update-java-alternatives -l
  1. 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
  1. Open the /etc/environment file for editing using the following command:
        sudo nano /etc/environment 
  1. 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" 
  1. Type Ctrl + X and choose Y to save and close the file.
  2. Next, reload the file using the following command:
        sudo source /etc/environment
主站蜘蛛池模板: 长葛市| 内黄县| 郓城县| 方城县| 岚皋县| 临洮县| 霍林郭勒市| 黎城县| 尼玛县| 南投市| 姚安县| 论坛| 高清| 惠州市| 乾安县| 渝中区| 嘉荫县| 山东省| 邹平县| 毕节市| 嘉义县| 蓬莱市| 武山县| 福泉市| 昌吉市| 民和| 海门市| 鄂尔多斯市| 鹤壁市| 福海县| 青河县| 潮安县| 邵东县| 宣武区| 中卫市| 新邵县| 大连市| 岳普湖县| 东方市| 新和县| 金坛市|