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

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
主站蜘蛛池模板: 广安市| 获嘉县| 乳源| 峨山| 汉川市| 万盛区| 白城市| 营山县| 文水县| 兴业县| 南宫市| 青铜峡市| 集贤县| 中方县| 玛多县| 黄浦区| 广昌县| 南木林县| 北京市| 辽中县| 嘉荫县| 绩溪县| 宁夏| 汾西县| 吉林省| 云梦县| 南昌县| 内黄县| 中山市| 托克逊县| 高清| 绥芬河市| 中卫市| 宣威市| 平武县| 丹江口市| 余江县| 邻水| 漳州市| 寻甸| 三台县|