5

When I try to install something it gives me this error:

HTTP request sent, awaiting response... 403 Forbidden
2014-04-23 09:32:53 ERROR 403: Forbidden.

download failed

Oracle JDK 7 is NOT installed........

But I have Oracle JDK 7 installed :

mostafa@mostafa-EP31-DS3L:~$  sudo update-alternatives --config java

 0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
 1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
\* 2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1         manual mode

Press enter to keep the current choice[*], or type selection number: 

what is the problem and how can I resolve this?

2 Answers 2

9

as you know oracle bans some countries and ... first add the key:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

then use apt-install to install the package:

sudo apt-get install oracle-java7-installer

after getting error 403, use ls:

ls /var/cache/oracle-jdk7-installer/

jar.binfmt  javaws-wrapper.sh  jdk-7u55-linux-x64.tar.gz  wgetrc

copy .tar.gz filename and search/download it on the web (http://enos.itcollege.ee/~jpoial/download/jdk7/).

then copy downloaded file to cache:

sudo cp ~/Downloads/jdk-7u55-linux-x64.tar.gz /var/cache/oracle-jdk7-installer/

to ensure that you download the correct file, use md5sum:

md5sum jdk-7u55-linux-x64.tar.gz
9e1fb7936f0e5aaa1e64d36ba640bc1f jdk-7u55-linux-x64.tar.gz

the result must match with oracle checksum at http://www.oracle.com/technetwork/java/javase/downloads/java-se-binaries-checksum-1956892.html

after this if you run the install command, the installation will be done correctly using cached file:

sudo apt-get install oracle-java7-installer
2
0

Don't worry about installation jdk 7. SDKMAN is here to resolve your issue. SDKMAN installation is given in this link

It gives a list of java version. You can install all of them. If you have multiple java version, you can specify one of them. You can also set default java version as required.

===============================
$ sdk list java
$ sdk install java 7u141-zulu
$ sdk use java 7u141-zulu
$ sdk default java 7u141-zulu
===============================

For Details,

$ sdk list java

It gives a list of java version

$ sdk install java 7u141-zulu

It installs java 7

$ sdk use java 7u141-zulu

  • If you want to use java 7, you can run this command.
  • For specific project, you can use specific java version using SDKMAN

$ sdk default 7u141-zulu

It is used to set java 7 as default.

rizvi@rizvi-pc:~$ sdk list java

============================================
Available Java Versions
============================================
   * 9.0.1-zulu                                                                    
     9.0.1-oracle                                                                  
     9.0.0-zulu                                                                    
     8u152-zulu                                                                    
     8u151-oracle                                                                  
     8u144-zulu                                                                    
     8u131-zulu                                                                    
   * 7u141-zulu                                                                    
   * 6u93-zulu                                                                     

=========================================================
+ - local version
* - installed
> - currently in use
=========================================================

You can also use this for multiple gradle

$ sdk install gradle 4.3
$ sdk install gradle 3.0
$ sdk use gradle 4.3 
$ sdk default gradle 4.3

For other installation like scala, groovy, you can follow this tutorial

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .