![]() It will function great if you obtain the suitable OpenJDK from the official repository. However, even after executing sudo apt- get updateĮven though it should be, the OpenJDK package is not always found in the repository. DoneĮ: Unable to locate package openjdk -8 -jdk ~ /Java$ sudo apt -get install openjdk -8 -jdkīuilding dependency tree Reading state information. Along with the installation failure notice, this message will be displayed.īy the way, this is a typical error message, and any such message must disturb the user. During the installation, this error might be noticed. You must manually install JDK if you wish to utilise it. Ubuntu Server does not include OpenJDK by default, which implies that when you install Ubuntu Server, it will not include OpenJDK. What is Unable to Locate Package openjdk 8 jre In this blog article, we'll look at the error message "Unable to locate package openjdk 8 jre" that arises during OpenJDK installation on Linux(Ubuntu), explain what it means, why it happens, and how to fix it. Our Platform Kodlogs gives mistake solutions that are simple for newbies to understand, as well as assistance for those who have forgotten things for various reasons. The difference between a computer and a human being is that a human can forget when performing a task repeatedly, increasing the chances of error, but a computer can execute the same activity again in the best possible manner without making a mistake. To set the environment variables for a specific user, place the above variables in the ~/.bash_profile file.In the course of our work, we will not always be able to complete everything correctly. Set variables based on the Java location and version for all users. For example, to run Java programs from anywhere, you need to set $JAVA_HOME and other variables to match your version of Java.Ĭreate a new file under /etc/profile.d directory. Java applications often require JAVA environment variables to be set in the system. The output may vary depending upon the package and the version you chose to be the default Java version. OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing) OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2) Verify Java VersionĬheck the java version using the following command. Press to keep the current choice, or type selection number: 1Įnter the number below the selection column to set the default Java version. There are 4 choices for the alternative java (providing /usr/bin/java).Ġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto modeġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual modeĢ /usr/lib/jvm/jdk-11.0.12/bin/java 2 manual modeģ /usr/lib/jvm/jdk-16.0.2/bin/java 1 manual mode If your system has multiple Java versions, then the command would list all Java versions like below. ![]() Use the alternatives command to set the default java version. Sudo update-alternatives -install /usr/bin/java java /usr/lib/jvm/jdk1.8.*/bin/java 3 Sudo update-alternatives -install /usr/bin/java java /usr/lib/jvm/jdk-11.*/bin/java 2 Sudo update-alternatives -install /usr/bin/java java /usr/lib/jvm/jdk-16.*/bin/java 1 Run update-alternatives commands to install Java on your system. ![]() Sudo tar -zxvf jdk-8u301-linux-圆4.tar.gz -C /usr/lib/jvm/ Install Oracle Java JDK/JRE Install / Extract the downloaded Oracle Java package. ![]() Wget -no-check-certificate -no-cookies -header "Cookie: oraclelicense=accept-securebackup-cookie" If you still want to use the command line, use the below command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |