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

Installing Java

Follow these steps to install Java:

  1. Update the package index using following command:
        sudo apt-get update 
  1. Next, install Java. The following command will install the JRE:
        sudo apt-get install default-jre 
  1. To set the JAVA_HOME environment variable, first 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
主站蜘蛛池模板: 河南省| 突泉县| 沂南县| 肥西县| 长沙县| 科技| 大港区| 盘锦市| 凌源市| 维西| 宁城县| 建瓯市| 杭州市| 会昌县| 卫辉市| 宝丰县| 木兰县| 临猗县| 台中县| 宁津县| 繁峙县| 香格里拉县| 交城县| 温泉县| 丹凤县| 襄城县| 梅河口市| 富蕴县| 黎川县| 定州市| 独山县| 讷河市| 桓台县| 哈巴河县| 中牟县| 镇远县| 松原市| 呈贡县| 伊宁县| 洪洞县| 如皋市|