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

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
主站蜘蛛池模板: 崇州市| 弋阳县| 房山区| 额济纳旗| 额济纳旗| 晋中市| 天门市| 静安区| 霍邱县| 绥中县| 廊坊市| 玛沁县| 江口县| 黎川县| 萍乡市| 拉萨市| 和顺县| 奉节县| 荥阳市| 嫩江县| 深泽县| 天全县| 南皮县| 汕尾市| 吴旗县| 泰来县| 湖南省| 陆良县| 武安市| 利辛县| 富裕县| 彭阳县| 晋城| 洪湖市| 洪雅县| 剑川县| 米林县| 麟游县| 沽源县| 乌苏市| 留坝县|