Removed Java 18 to replace with 17 but still 18 when run.
Jeffrey Walton
noloader at gmail.com
Wed Nov 23 03:47:24 UTC 2022
On Tue, Nov 22, 2022 at 9:47 PM Owen Thomas <owen.paul.thomas at gmail.com> wrote:
>
> My Java project, which uses Gradle 7.4, told me that this version of Gradle is incompatible with Java 18. I had a look here and was advised to use Java 17. So, I tried to remove Java 18 using "sudo apt remove openjdk-18-jdk" followed by "sudo apt install openjdk-17-jdk". When I run java --version I get the following result:
>
> openjdk 18.0.2-ea 2022-07-19
> OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)
> OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)
>
> I have tried to run this in a fresh CLI window, and the results are the same,
>
> What do I do now?
It looks like you still have the Java Runtime Environment (JRE)
installed. You should remove it, too.
The package name could be openjdk-18-jre, openjdk-18-jre-headless or
openjdk-18-jre-zero. So your command might look like:
$ sudo apt-get remove --purge \
openjdk-18-jre \
openjdk-18-jre-headless \
openjdk-18-jre-zero
This may help identify other interesting OpenJDK 18 packages:
$ apt-cache search '^openjdk*' | grep '\-18'
Jeff
More information about the ubuntu-users
mailing list