Score:1

javac 11 to 17 in Ubuntu 20.04

tw flag

I've recently tried to update java from sdk11 to sdk17. For that I've ran:

sudo apt update
sudo apt install openjdk-17-jdk

and set JAVA_HOME to /usr/lib/jvm/java-17-openjdk-amd64. The problem is that I'm not sure how to update javac... Currently I only have 1 version, the 11th.

java -version
openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu120.04)
OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu120.04, mixed mode, sharing)

javac -version
javac 11.0.17

Whenever, I compile a program in java it follows JDK11 instead of JDK17...

Score:2
in flag

The javac executable is not part of the openjdk-*-jdk packages. To install it, you need to install the openjdk-17-jdk-headless package:

sudo apt install openjdk-17-jdk-headless

To manage the active version, don't forget about the update-alternatives command:

sudo update-alternatives --config java
sudo update-alternatives --config javac
An old man in the sea. avatar
tw flag
Many thanks ! It worked. ;)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.