M
M
mr-ZA2019-06-13 14:54:10
linux
mr-ZA, 2019-06-13 14:54:10

Java SE JDK 12 and its installation in Linux Mint?

Hello everyone, I have a question about installing Java SE JDK 12 for programming on Linux Mint. Before that, in Windows, I simply downloaded packages, set variables, and everything compiled and ran in cmd without problems.
1) First of all, I downloaded SE 12 from offsite

https://www.oracle.com/technetwork/java/javase/dow...

2) Then I installed it using sudo dpkg -i java.deb
3) When I call the information in the console, I get something like this
sudo java -version     
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

Why am I getting a completely different version, I have jdk12? If I delete it, the system unambiguously hints that irreversible things will happen next:
sudo apt remove openjdk-11-jre openjdk-11-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ibm-java80-jre libreoffice-avmedia-backend -gstreamer libreoffice-base
libreoffice-base-core libreoffice-base-drivers libreoffice-calc
libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome
libreoffice-gtk3 libreoffice-impress libreoffice-java-common
libreoffice-math libreoffice-ogltrans libreoffice-pdfimport
libreoffice-sdbc-hsqldb libreoffice-style-galaxy libreoffice-style-tango libreoffice
-writer python3-uno
ibm-java80-plugin libreoffice-report-builder unixodbc libjtds-java
libreoffice-mysql-connector | libmyodbc | libmysql-java
libreoffice-sdbc-postgresql | odbc-postgresql | libpg-java libsqliteodbc
| tdsodbc | mdbtools libreoffice-sdbc-firebird ocl-icd-libopencl1
libreoffice-evolution libreofficekit-data tango-icon-theme
fonts-crosextra-caladea fonts-crosextra-carlito
Recommended packages:
gstreamer1.0-gtk3
The following packages will be REMOVED:
default-jre default-jre-headless openjdk-11-jre openjdk-11-jre-headless
The following NEW packages will be installed:
ibm-java80-jre
The following packages will be upgraded:
libreoffice-avmedia-backend-gstreamer libreoffice-base libreoffice-base-core
libreoffice-base-drivers libreoffice-calc libreoffice-common
libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3
libreoffice-impress libreoffice-java-common libreoffice-math
libreoffice -ogltrans libreoffice-pdfimport libreoffice-sdbc-hsqldb
libreoffice-style-galaxy libreoffice-style-tango libreoffice-writer
python3-uno
20 upgraded, 1 newly installed, 4 to remove and 451 not upgraded.
Need to get 194 MB of archives.
After this operation, 13.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

How can I replace these openjdk and openjre with freshly downloaded 12 versions?
How to set environment variables to refer to correct javac and java?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Satisfied IT, 2019-06-13
@mr-ZA

Where did you see irreversible things? Something will be deleted and something will be updated, that's it, no more terrible changes. Do it first sudo apt update && sudo apt dist-upgradeand then delete, the message will become a little less scary

S
sergey, 2019-06-13
kuzmin @sergueik

sudo update-alternatives --list java
it will show you what is already there and you will see openjdk 11
(mint is debian based) there

Usage: update-alternatives [<option> ...] <command>

Commands:
  --install <link> <name> <path> <priority>
    [--slave <link> <name> <path>] ...
                           add a group of alternatives to the system.

<link> is the symlink pointing to /etc/alternatives/<name>.
  (e.g. /usr/bin/pager)
<name> is the master name for this link group.
  (e.g. pager)
<path> is the location of one of the alternative target files.
  (e.g. /usr/bin/less)
<priority> is an integer; options with higher numbers have higher priority in
  automatic mode.

that is, you need a type
- your path will be different - I took a 16-bit cat from one of my test virtual machines. use for testing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question