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
You certainly deserve more followers and likes. You make things really easy. Thank you!
Same as above comment. I have got an error then I give the same instructions
Then it's runs
Thanks you so much ❣️
Thank you for great tutorials, helped me out a lot
Please like, share and subscribe.
Thanks bro, it worked perfectly
Please share and subscribe, Thanks.
Thanks bro, It works!
Please share and subscribe, Thanks.
Well detailed , Much love ... :)
Thanks, please like, share and subscribe.
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
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.
Thanks bro
As per your instructions I installed Java
Then how will be run Java files
Save your java code with .java extension, then you can run your java code using the javac command, eg: javac hello.java
@@what-and-how ok bro
@@what-and-how thanks you ❣️
Did not work
update-alternatives: error: alternative path /usr/lib/jvm/jdk-19/bin/javac doesn't exist