1

Trying to install jdk-21-oracle-x64 on Ubuntu 20.04 but it seems to be missing jvm.cfg.

cl install and test

Is this a Oracle problem or Ubuntu problem?

2 Answers 2

1

I encountered an error while trying to install JDK-17 on my Debian system. I installed it but accidentally uninstalled it. Upon reinstalling it, I encountered the

error: "Error: could not open `/usr/lib/jvm/jdk-17-oracle-x64/lib/jvm.cfg'"

Eventually, I resolved this issue by completely removing JDK-17 using Synaptic.
I think sudo apt purge jdk-17 should also work, as there may have been leftover files causing the problem. Sorry,My English is terrible,good luck!

0
0

I tried installing Java 21 from Oracle's site running Ubuntu 20.04 (using Docker) and it seemed to work. Here's what I did:

 docker run --name ubuntu-test --rm -it ubuntu:20.04
root@f5f73a3cc94f:/# apt update -qq &> /dev/null && apt install -y -qq curl &> /dev/null
root@f5f73a3cc94f:/# curl -s https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb -o jdk-21_linux-x64_bin.deb
root@f5f73a3cc94f:/# java --version
bash: java: command not found
root@f5f73a3cc94f:/# dpkg -i jdk-21_linux-x64_bin.deb
Selecting previously unselected package jdk-21.
(Reading database ... 4666 files and directories currently installed.)
Preparing to unpack jdk-21_linux-x64_bin.deb ...
Unpacking jdk-21 (21.0.2-ga) ...
Setting up jdk-21 (21.0.2-ga) ...
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jdeprscan to provide /usr/bin/jdeprscan (jdeprscan) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jfr to provide /usr/bin/jfr (jfr) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jhsdb to provide /usr/bin/jhsdb (jhsdb) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jimage to provide /usr/bin/jimage (jimage) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jlink to provide /usr/bin/jlink (jlink) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jmod to provide /usr/bin/jmod (jmod) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jpackage to provide /usr/bin/jpackage (jpackage) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jshell to provide /usr/bin/jshell (jshell) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/jwebserver to provide /usr/bin/jwebserver (jwebserver) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-21-oracle-x64/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
update-alternatives: error: error creating symbolic link '/usr/share/binfmts/jar.dpkg-tmp': No such file or directory
root@f5f73a3cc94f:/# java --version
java 21.0.2 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

If installing the DEB package does not work for you, you can try other alternatives:

  1. Install the officially-supported OpenJDK: sudo apt update && sudo apt install openjdk-21-jdk.
  2. Install another JDK from another vendor. One example is Zulu.
  3. Use a Java version manager such as SDKMAN or asdf-java.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .