How to install Java on Linux Mint, Ubuntu, Other Linux Distributions

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ต.ค. 2022
  • An easy installation guide on how to install the latest version of java in linux debian distributions (Ubuntu, linux mint etc).
    1. Commands for java and javac setup
    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-19/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-19/bin/javac" 1
    2. jdk path to add in bashrc
    export JAVA_HOME=/usr/lib/jvm/jdk-19
    export PATH="$PATH:$JAVA_HOME/bin"
    #jdk #java #javainstall #javalinux #linux_tutorial

ความคิดเห็น • 18

  • @mariopantoja4265
    @mariopantoja4265 ปีที่แล้ว

    You certainly deserve more followers and likes. You make things really easy. Thank you!

  • @shaikosama
    @shaikosama ปีที่แล้ว +1

    Same as above comment. I have got an error then I give the same instructions
    Then it's runs
    Thanks you so much ❣️

  • @Olegator56
    @Olegator56 ปีที่แล้ว

    Thank you for great tutorials, helped me out a lot

    • @what-and-how
      @what-and-how  ปีที่แล้ว

      Please like, share and subscribe.

  • @samed3554
    @samed3554 ปีที่แล้ว +1

    Thanks bro, it worked perfectly

    • @what-and-how
      @what-and-how  ปีที่แล้ว

      Please share and subscribe, Thanks.

  • @lightivandambys2834
    @lightivandambys2834 ปีที่แล้ว

    Thanks bro, It works!

    • @what-and-how
      @what-and-how  ปีที่แล้ว

      Please share and subscribe, Thanks.

  • @huhthechannel
    @huhthechannel ปีที่แล้ว

    Well detailed , Much love ... :)

    • @what-and-how
      @what-and-how  ปีที่แล้ว

      Thanks, please like, share and subscribe.

  • @887363
    @887363 ปีที่แล้ว +4

    when I try to run the sudo dpkg -i command I get this error, any ideas?
    I have checked mutiple times to confirm spelling is all good and I am in the right folder.
    dpkg: dependency problems prevent configuration of jdk-19:
    jdk-19 depends on libc6-i386; however:
    Package libc6-i386 is not installed.
    jdk-19 depends on libc6-x32; however:
    Package libc6-x32 is not installed.
    dpkg: error processing package jdk-19 (--install):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    jdk-19

    • @what-and-how
      @what-and-how  ปีที่แล้ว +3

      Run the installation command sudo dpkg -i ... If you are getting the error,
      run this command "sudo apt install -f"
      Give y for yes and press enter, wait for the process to finish.
      Now run the installation command sudo dpkg -i again. Hope this will fix your issue.

  • @shaikosama
    @shaikosama ปีที่แล้ว +1

    Thanks bro
    As per your instructions I installed Java
    Then how will be run Java files

    • @what-and-how
      @what-and-how  ปีที่แล้ว +1

      Save your java code with .java extension, then you can run your java code using the javac command, eg: javac hello.java

    • @shaikosama
      @shaikosama ปีที่แล้ว +2

      @@what-and-how ok bro

    • @shaikosama
      @shaikosama ปีที่แล้ว +1

      @@what-and-how thanks you ❣️

  • @noblewolfy
    @noblewolfy 8 หลายเดือนก่อน

    Did not work

  • @kjnei
    @kjnei 7 หลายเดือนก่อน

    update-alternatives: error: alternative path /usr/lib/jvm/jdk-19/bin/javac doesn't exist