I'm trying to install Java JDK 8 with this instruction:
apt-get update -y
apt-get install -y python-software-properties
add-apt-repository ppa:webupd8team/java
apt-get update -y
apt-get install -y oracle-java8-installer
but I get a 404 while I'm running last command:
Connecting to download.oracle.com
(download.oracle.com)|95.101.180.41|:80... connected. HTTP request
sent, awaiting response... 404 Not Found 2017-10-18 10:33:03 ERROR
404: Not Found.
download failed
How many days since this problems happens? It is strange a 404 for a Java installer. Isnt'it? Any workaround?
You can try to install java 8 manually.
Just download java (tar.gz) from oracle site.
Then, create directory for your jdk like (of course if folder doesn't exist)
$/opt/jdk
and extract java into created folder.
$tar -zxf jdk-8u152-linux-x64.tar.gz -C /opt/jdk
Then, it is very important, to set it as the default JVM in your machine run.
Just use that command:
$update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_152/bin/java 100
and
$update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_152/bin/javac 100
Now, verify that java installed correctly.
$java -version
A new SDK version is out and the old version is no longer available. Wait for a updated package, install manually or use OpenJDK.
Related
I'm new to Raspberry-Pi & Linux and I wanted to code up a Minecraft server using PaperMC, but when I ran the server I got a warning saying that Java-11 would no longer be supported in future builds, so I thought it would be easy enough to upgrade to Java-16. I have not found documentation regarding this topic specifically which has led to using parts of differing tutorials, and I think I made a few mistakes. To start, I purged the old Java-11 version like so:
sudo -i
apt-get purge openjdk*
apt-get purge java11*
apt-get autoremove
Then I moved to the jvm directory and installed Java-16 from AdpotOpenJDK:
cd /usr/lib/jvm
wget https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jre_aarch64_linux_hotspot_16.0.1_9.tar.gz
tar xzf OpenJDK16U-jre_aarch64_linux_hotspot_16.0.1_9.tar.gz
export PATH=$PWD/jdk-16.0.1+9-jre/bin:$PATH
java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)
This export PATH command seems to be temporary, when I logout of sudo or exit the command window, and then check java -version again I get that the java command is not found. If I try setting JAVA_HOME & PATH:
export JAVA_HOME="/usr/lib/jvm/jdk-16.0.1+9-jre"
export PATH=$PATH:$JAVA_HOME/bin
The result is also temporary. Why can't I set this Java-16 as the default? Do I need to make a script that runs these commands on startup?
Here is a way to install it permanently using apt. Link to the information
https://paper.readthedocs.io/en/latest/java-update/index.html#debian-ubuntu
$ sudo apt update
$ sudo apt install apt-transport-https software-properties-common gnupg wget
$ wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
$ sudo add-apt-repository https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
$ sudo apt update
$ sudo apt install adoptopenjdk-16-hotspot
I want to install & configure openjdk 11 on Linux(vm in azure devops) either by yum or wget , i am new, not sure i tried using wget but openjdk 11 is not downloading
Need OpenJDK 11 to run Sonarqube
According to this post here: https://superuser.com/questions/1466580/unable-to-download-oracle-jdk-8-using-wget-command
"Following a licensing change of Oracle Java on 16 April 2019, Oracle now forbids anyone from downloading Java outside of their approved process.
That process is currently to log in to an Oracle account, accept the new license, then attempt the download with the authentication cookies in place."
In order to download it now you must use apt-get command if you use ubuntu or debian so on.
I know it says java 8 but this applies to all java versions
EDIT: I do not use centos so I cannot personally test this but try if this works
$ sudo yum install java-11-openjdk-devel
or
$ sudo yum install java-11-openjdk
You can try below scripts to install jdk 11 on azure linux vm.
sudo rpm --import http://repos.azul.com/azul-repo.key
sudo curl http://repos.azul.com/azure-only/zulu-azure.repo -o /etc/yum.repos.d/zulu-azure.repo
sudo yum -q -y update
sudo yum -q -y install zulu-11-azure-jdk
See here for more information.
I initially had default-jdk and default-jre installed on Ubuntu 18.04.
Attempted to host a Minecraft Server for a friend, but was given the error found here
I followed the commentor's advice to reinstall java version 8 rather than version 11 installed above, by following this advice here that being
sudo rm -r /usr/lib/jvm/java-11-oracle
but as a mistake I had removed all files in that folder, leaving just the two directories
java-11-openjdk-amd64
java-8-openjdk-amd64
since then I have attempted to reinstall java using sudo apt-get install default-jdk ; sudo apt-get install default-jre and they install just fine, but running java -version, either as root or as user, returns:
Command 'java' not found, but can be installed with:
sudo apt install default-jre
sudo apt install openjdk-11-jre-headless
sudo apt install openjdk-8-jre-headless
I have scoured askubuntu, digitalocean, and stackoverflow for some answers but I can't find anything that fixes this problem. I also asked my roommate, who is an experienced Computer Science major and who has used ubuntu extensively in the past, and he couldn't find a solution. Has anyone encountered this issue before?
I appreciate any and all responses 😊
Solution has been found. Running:
sudo apt purge -y openjdk-11-jre-headless
sudo apt purge -y openjdk-8-jre-headless
sudo apt purge -y default-jdk
and reinstalling has resolved the issue
Check your path. You should have remove the old jdk using apt-get. I think your system still assumes the old jdk-11 is still present. You could try to re-install it or use update-alternatives to switch to the other version.
Every time I try to install something from terminal this message pops up to me. Meanwhile I have my Java installed right:
download failed
Oracle JDK 9 is NOT installed.
dpkg: error processing package oracle-java9-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java9-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
Please can someone help me solve this; it's really annoying.
sudo apt-get purge oracle-java9-installer
solved my issue.
Later I also changed Ubuntu Software center server to "Main Server".
Actually I hit the issue after resolving the wine installation on my Ubuntu 16.04 LTS box. The wine issue I resolved using the below link.
https://askubuntu.com/questions/935050/unknown-error-class-keyerror-the-cache-has-no-package-named-wine1-6-i38
So that landed me to this post. But I was not able to install the java from apt packages. It threw me errors. Then I realized it was the issue of having multiple Java instances on my system. I already had Oracle Java 9 installed. I just needed to change the current verions using the command
sudo update-alternatives --config java
So if any body hits the error, you can try setting this.
I was getting the same error so using this command first i removed Java 9
sudo apt remove oracle-java9-installer
Then I made Java 8 as default
sudo apt-get install oracle-java8-set-default
After this if you try to install other software it will work or you can also upgrade Java 8 to Java 9.
First, add Oracle's PPA, then update your package repository.
$sudo add-apt-repository ppa:webupd8team/java
$sudo apt-get update
To install JDK 9, use the following command:
$sudo apt-get install oracle-java9-installer
I'm not sure what steps you have tried already to install it but the link below is a fairly well explained description of how to install the JDK on Ubuntu. I've always installed the JDK through the webupd8team's ppa and its worked for me so far :)
A note about the link, it suggests setting the home variable, this may be necessary for you but I've never had to it manually and it's worked so give it a quick check before setting the home variable yourself.
https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
Solved the problem removing all java versions and purging them and re-installing them again probably, thanks everyone who tried to help.
Completely removal criteria:
To remove Oracle JDK completely, run the commands below:
sudo apt-get remove oracle-java9-installer
sudo apt-get remove --auto-remove oracle-java9-installer
sudo apt-get purge oracle-java9-installer
sudo apt-get purge --auto-remove oracle-java9-installer
Resource Link:
https://www.howtoinstall.co/en/ubuntu/trusty/tomcat7?action=remove
After that, install jdk9 using the following command:
Install JDK9 in Ubuntu:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java9-installer
Make it as default:
sudo apt-get install oracle-java9-set-default
Resource Link:
http://zakirrizvi.blogspot.com/2017/10/install-jdk9-in-ubuntu.html
I just downloaded Arduinoe ID 1.6.8 from arduino.cc . Placed it in home folder Then ran command ./arduino .
The Error that occurred:
java.lang.NoSuchMethodError:
org.apache.commons.compress.utils.IOUtils.closeQuietly(Ljava/io/Closeable;)V
at processing.app.helpers.PreferencesMap.load(PreferencesMap.java:76)
at processing.app.PreferencesData.init(PreferencesData.java:53)
at processing.app.BaseNoGui.initParameters(BaseNoGui.java:993)
at processing.app.Base.guardedMain(Base.java:159)
at processing.app.Base.main(Base.java:137)
If it's still actual or not I answer anyway.
I met the same problem after a dist-upgrade. The solution for me was just to upgrade openjdk from 6th to 7th version:
$ sudo apt-get install openjdk-7-jre openjdk-7-jre-lib openjdk-7-jre-headless
$ sudo apt-get --purge remove openjdk-6-jre openjdk-6-jre-lib openjdk-6-jre-headless