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

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
主站蜘蛛池模板: 白沙| 晋宁县| 延寿县| 宜君县| 吐鲁番市| 扎赉特旗| 平罗县| 内丘县| 贵德县| 南充市| 淳安县| 壶关县| 景洪市| 讷河市| 丹巴县| 河东区| 洪雅县| 额济纳旗| 眉山市| 邯郸县| 恩平市| 永兴县| 桓仁| 弋阳县| 师宗县| 右玉县| 义马市| 华宁县| 平利县| 长治县| 上杭县| 德阳市| 阿勒泰市| 宝清县| 彰武县| 苏州市| 福安市| 毕节市| 英山县| 建始县| 望城县|