There is a fetch restriction, which will give instructions along the lines of:
Output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Fetch instructions for dev-java/oracle-jdk-bin-1.8.0.92:
*
* Oracle requires you to download the needed files manually after
* accepting their license through a javascript capable web browser.
*
* Download the following files:
* jdk-8u92-linux-x64.tar.gz
* at 'http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html'
* and move them to '/usr/portage/distfiles'
*
* If the above mentioned urls do not point to the correct version anymore,
* please download the files from Oracle's java download archive:
*
* http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html#jdk-8u92-oth-JPR
*
Download the jdk-version-linux-x64.tar.gz file the fetch instructions required and put it in /usr/portage/distfiles. Then run the emerge command again.
Selecting the System JDK
List the available JDKs installed:
Console - user@hostname ~ $
1
java-config --list-available-vms
There is an * for the currently selected JDK:
Output
1
2
3
4
ec2-user@ip-172-30-0-196 ~ $ java-config --list-available-vms
The following VMs are available for generation-2:
1) IcedTea JDK 7.2.6.6 [icedtea-bin-7]
*) IcedTea JDK 3.0.1 [icedtea-bin-8]
We can see where the current JDK is installed:
Console - user@hostname ~ $
1
java-config --jdk-home
Output
1
/opt/icedtea-bin-3.0.1
We can switch to another JDK like so, in this case icedtea-bin-7:
Console - user@hostname ~ $
1
sudo java-config --set-system-vm icedtea-bin-7
Output
1
Now using icedtea-bin-7 as your generation-2 system JVM
Console - user@hostname ~ $
1
java-config --list-available-vms
Output
1
2
3
The following VMs are available for generation-2:
*) IcedTea JDK 7.2.6.6 [icedtea-bin-7]
2) IcedTea JDK 3.0.1 [icedtea-bin-8]
Console - user@hostname ~ $
1
java-config --jdk-home
Output
1
/opt/icedtea-bin-7.2.6.6
Setting JAVA_HOME
JAVA_HOME is automatically set, but you need to logout and back in again after installation for it to be set.