...
Установить OpenJDK 8 вместе с исходниками из репозитория:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
sudo apt install openjdk-8-jdk openjdk-8-source |
2. Выбрать версию Java 8 как приложение по умолчанию
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2 |
Выберите номер строчки, в котором указана 8 версия Java (в примере - строчка с №2). После нажмите <enter> для подтверждения выбора.
3. Установить IcedTea
Зайти на сайт https://adoptopenjdk.net/icedtea-web.html и скачать версию 1.8.8:
...
Открыть каталог с загрузками, распаковать архив, создать каталог и скопировать туда бинарники:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
cd ~/Downloads
unzip icedtea-web-1.8.8.linux.bin.zip
cd /opt
sudo mkdir icedtea
sudo cp -r ~/Downloads/icedtea-web-image/ /opt/icedtea/ |
Прописать IcedTea в $PATH:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
sudo nano /etc/environment |
В конец строчки добавить ":/opt/icedtea/icedtea-web-image/bin
", чтобы получилось что-то похожее:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/icedtea/icedtea-web-image/bin" |
...
4. Проверить работоспособность
Сначала надо завершить сеанс пользователя и зайти снова.
Проверить, что Java запускается:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
$ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode) |
Проверить, что IcedTea тоже работает:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
$ javaws --version
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre
icedtea-web 1.8.8 |
...
Для GNOME (включая такие оболочки как Cinnamon), помимо всего перечисленного, нужно отключить вспомогательные технологии GNOME:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
|
sudo nano /etc/java-8-openjdk/accessibility.properties |
Закомментировать строку assistive_technologies=org.GNOME.Accessibility.AtkWrapper, чтобы получилось:
Блок кода |
---|
language | bash |
---|
theme | Midnight |
---|
title | /etc/java-8-openjdk/accessibility.properties |
---|
|
#
# The following line specifies the assistive technology classes
# that should be loaded into the Java VM when the AWT is initailized.
# Specify multiple classes by separating them with commas.
# Note: the line below cannot end the file (there must be at
# a minimum a blank line following it).
#
#assistive_technologies=org.GNOME.Accessibility.AtkWrapper
|
...