Installing Java on ubuntu and
Just a forewarning, I'm incredibly new to UNIX in general, so if you could keep all answers relatively simple that would be great
I am trying to install java on my machine, and when I try to install the .rpm file, I get an error that tells me I am missing dependencies.
Any suggestions?
These are the errors:
root@cole-ThinkPad-T440s:/home/cole/java# rpm -ivh jdk-8u111-linux-x64.rpm
rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
error: Failed dependencies:
/bin/basename is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/cat is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/cp is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/gawk is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/grep is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/ln is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/ls is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/mkdir is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/mv is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/pwd is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/rm is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/sed is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/sort is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/bin/touch is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/bin/cut is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/bin/dirname is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/bin/expr is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/bin/find is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/bin/tail is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/bin/tr is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/bin/wc is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
/usr/sbin/update-alternatives is needed by jdk1.8.0_111-2000:1.8.0_111- fcs.x86_64
/bin/sh is needed by jdk1.8.0_111-2000:1.8.0_111-fcs.x86_64
root@cole-ThinkPad-T440s:/home/cole/java#
Once I install java, I also want to set the jdk so that eclipse can locate it. I could also use a bit of help on how to do that
OpenJDK is a development environment for building applications, applets, and components using the Java programming language. To install OpenJDK 9 in Ubuntu 16.04 from the terminal type:
sudo apt install openjdk-9-jdk
To install OpenJDK 8 replace the 9 in the above command with 8.
To display the path to the default JDK type:
update-alternatives --display java
To install Oracle's proprietary Java JDK from a .deb file that is downloaded from the Oracle website see How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?
Because you may have installed multiple versions of Java from .rpm files, .deb files and/or directly from the Ubuntu repositories, it is possible that you may have messed up the Java path. This question is about how to change the Java path after installing Java from multiple sources - Ubuntu: change the path from OpenJDK 6 to Oracle JDK 7
You can use either sudo update-alternatives --config java
(update-alternatives is provided by default by dpkg in Ubuntu) or update-java-alternatives
(which is installed when openjdk-9-jdk is installed) to manually choose which Java to use before running an application. See update-java-alternatives vs update-alternatives --config java.