-1

I downloaded the file graalvm-ce-java17-linux-amd64-22.3.0.tar.gz and extract to the location usr/lib/jvm.

Then i set the environment path with command
export PATH=/path/to/<graalvm>/bin:$PATH and
export JAVA_HOME=/path/to/<graalvm>

After that i tried to run sudo update-alternatives --config java but could not find the list of installed graalvm java.

Other java version installed from terminal are shown but manual download setup java not appear in update-alternatives --config java.

1
  • update-alternatives is part of the dpkg system. Why do you expect it to recognize manually installed programs? If it did, how would it be able to determine the version number?
    – doneal24
    Dec 26, 2022 at 18:20

1 Answer 1

1

Manually it won't recognize by update-alternatives. In order to do that, we have to provide following command in terminal :

$ sudo update-alternatives --install /usr/bin/java java /path/to/<graalvm>/bin/java 4
$ sudo update-alternatives --install /usr/bin/javac javac /path/to/<graalvm>/bin/javac 4

This will add into the list of update-alternatives database of dpkg system. Next time whenever you run update-alternatives --config java command, it will appear in terminal.

Additional Info:

Here 4 number represent the priority order , you can set highest number than any other priority number set for jdk so in auto mode it pick up jdk with highest priority number.

Beside this work for other jdk that is downloaded manually as tar or zip file.

You must log in to answer this question.

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