Installing jdk8 on ubuntu- “unable to locate package” update doesn't fix

前端 未结 8 1213
野性不改
野性不改 2021-02-02 09:37

I\'ve been trying to install the jdk on my ubuntu after downloading it.

first I\'ve used: sudo apt-get update

then: sudo apt-get install jdk*

8条回答
  •  别那么骄傲
    2021-02-02 10:04

    Ubuntu defaults to the OpenJDK packages. If you want to install Oracle's JDK, then you need to visit their download page, and grab the package from there.

    Once you've installed the Oracle JDK, you also need to update the following (system defaults will point to OpenJDK):

    export JAVA_HOME=/my/path/to/oracle/jdk
    export PATH=$JAVA_HOME/bin:$PATH
    

    If you want the Oracle JDK to be the default for your system, you will need to remove the OpenJDK packages, and update your profile environment variables.

提交回复
热议问题